#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)
by , 10 years ago
Attachment: | 0001-Fix-a-bug-in-config-typechecking.patch added |
---|
comment:1 by , 10 years ago
by , 10 years ago
Attachment: | 0001-Added-test-case-for-overwriting-null-config-values.patch added |
---|
comment:2 by , 10 years ago
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 by , 10 years ago
Thanks, I've added to develop
your test [3b950094] and fixed the issue [11c6e387].
comment:4 by , 10 years ago
Resolution: | → Fixed |
---|---|
Status: | new → closed |
comment:5 by , 9 years ago
Milestone: | 2.0.x → 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?