#2510 closed patch (Fixed)
Bug in config.py type checking
Reported by: | awknaust | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 2.0.0 |
Component: | Core | Version: | develop |
Keywords: | config | Cc: |
Description
The old (1.37) compared types properly but in development, isinstance is being misused. This resulted in a exceptions when a new config option was being added (maybe when moving the preferences dialog)
Attachments (2)
Change History (8)
Changed 9 years ago by awknaust
comment:1 Changed 9 years ago by Cas
Changed 9 years ago by awknaust
comment:2 Changed 9 years ago by awknaust
This is an example traceback. I wrote a short test case to cover this scenario
Traceback (most recent call last): File "/home/awknaust/deluge/deluge/ui/gtkui/preferences.py", line 831, in on_pref_dialog_configure_event self.gtkui_config["pref_dialog_width"] = event.width File "/home/awknaust/deluge/deluge/config.py", line 148, in __setitem__ return self.set_item(key, value) File "/home/awknaust/deluge/deluge/config.py", line 189, in set_item value = oldtype(value) TypeError: cannot create 'NoneType' instances
comment:3 Changed 9 years ago by Cas
Thanks, I've added to develop your test [3b950094] and fixed the issue [11c6e387].
comment:4 Changed 9 years ago by Cas
- Resolution set to Fixed
- Status changed from new to closed
comment:5 Changed 8 years ago by Cas
- Milestone changed from 2.0.x to 2.0
Note: See
TracTickets for help on using
tickets.
Using isinstance is the correct usage to compare types, I just messed up the implementation here.
A test needs add to test_config to replicate this issue and ensure it is fixed.
Do you have the exception trace or how to replicate?