After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654847 - AttributeError: 'NoneType' object has no attribute 'rfind'
AttributeError: 'NoneType' object has no attribute 'rfind'
Status: RESOLVED FIXED
Product: meld
Classification: Other
Component: dirdiff
1.5.x
Other Linux
: Normal normal
: ---
Assigned To: meld-maint
meld-maint
Depends on:
Blocks:
 
 
Reported: 2011-07-18 13:35 UTC by Dominic Hopf
Modified: 2011-12-02 21:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dominic Hopf 2011-07-18 13:35:03 UTC
This issue was originally reported against the Fedora package of meld:
https://bugzilla.redhat.com/show_bug.cgi?id=722622

This backtrace occurs when model.value_path(child, pane) returns None:

backtrace:
:posixpath.py:112:basename:AttributeError: 'NoneType' object has no attribute
'rfind'
:
:Traceback (most recent call last):
:  File "/usr/share/meld/meld/meldwindow.py", line 568, in on_file_changed
:    page.on_file_changed(filename)
:  File "/usr/share/meld/meld/dirdiff.py", line 1121, in on_file_changed
:    name = os.path.basename(model.value_path(child, pane))
:  File "/usr/lib64/python2.7/posixpath.py", line 112, in basename
:    i = p.rfind('/') + 1
:AttributeError: 'NoneType' object has no attribute 'rfind'
:
:Local variables in innermost frame:
:p: None


This is quite reproducible on the command line, even if I don't know in which cases model.value_path returns None:

% python -c 'import os; os.path.basename(None)'
Traceback (most recent call last):
  • File "<string>", line 1 in <module>
  • File "/usr/lib64/python2.7/posixpath.py", line 112 in basename
    i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'


An idea to resolve this issue would be to just call os.path.basename if model.value_path does not return None.
Comment 1 Kai Willadsen 2011-12-02 21:50:29 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.