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 661910 - Dots spits up when opening extension-less files
Dots spits up when opening extension-less files
Status: RESOLVED FIXED
Product: dots
Classification: Other
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Joanmarie Diggs (IRC: joanie)
dots-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-16 14:09 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2011-10-29 19:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (965 bytes, patch)
2011-10-16 14:13 UTC, Joanmarie Diggs (IRC: joanie)
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2011-10-16 14:09:18 UTC
Steps to reproduce:

1. Create a document in gedit and save it without a file extension.
2. Open the document in Dots

Expected results: The file would be opened.

Actual results: The file is not opened and the following traceback is shown:

Traceback (most recent call last):
  • File "/usr/lib/python2.7/site-packages/dots/app_window.py", line 238 in _onOpen
    self.document = document_new (filename)
  • File "/usr/lib/python2.7/site-packages/dots/document_builder.py", line 76 in document_new
    if mime_type.startswith("text/"):
AttributeError: 'NoneType' object has no attribute 'startswith'

Comment 1 Joanmarie Diggs (IRC: joanie) 2011-10-16 14:13:56 UTC
Created attachment 199121 [details] [review]
proposed fix

Fall back to guessing plaintext.

(Also nuked some print statements whilst I was in there.)
Comment 2 Fernando Herrera 2011-10-26 04:10:22 UTC
Comment on attachment 199121 [details] [review]
proposed fix

Looks great, please go ahead and commit.

Thanks!