[Diffuse-users] Preferences update error?
Status: Beta
Brought to you by:
dtmoser
|
From: Eizan M. <eiz...@gm...> - 2014-05-13 17:04:49
|
Hi everyone,
I've recently come across a possible(?) bug in the most recent Diffuse
release (0.4.7). Basically, when I try to update a particular preference
item, the change won't take and I get some errors spit out to my console. I
don't see anything related to this on the bug tracker.
More specifically, when I tick Preferences->Display->ignore end of line
differences, the following error is emitted:
Traceback (most recent call last):
File "/usr/bin/diffuse", line 8098, in preferences_cb
if self.prefs.runDialog(self.get_toplevel()):
File "/usr/bin/diffuse", line 1003, in runDialog
ss.append('%s "%s"\n' % (k, v.replace('\\', '\\\\').replace('"',
'\\"')))
AttributeError: 'NoneType' object has no attribute 'replace'
When I apply the following patch, the issue goes away, but it's a pretty
messy hack:
@@ -995,13 +995,13 @@ class Preferences:
try:
ss = []
for k, v in self.bool_prefs.items():
- if v != self.default_bool_prefs[k]:
+ if v is not None and v != self.default_bool_prefs[k]:
ss.append('%s %s\n' % (k, v))
for k, v in self.int_prefs.items():
- if v != self.default_int_prefs[k]:
+ if v is not None and v != self.default_int_prefs[k]:
ss.append('%s %s\n' % (k, v))
for k, v in self.string_prefs.items():
- if v != self.default_string_prefs[k]:
+ if v is not None and v != self.default_string_prefs[k]:
ss.append('%s "%s"\n' % (k, v.replace('\\',
'\\\\').replace('"', '\\"')))
ss.sort()
f = open(self.path, 'w')
Or, do I perhaps have Diffuse installed incorrectly? I installed it with:
$ install.py --prefix=$HOME/opt --destdir=$HOME/opt
note:
$ uname -a
Linux debian 3.2.0-4-486 #1 Debian 3.2.54-2 i686 GNU/Linux
$ python --version
Python 2.7.3
Thanks!
Eizan
|