[Reportbug-maint] Bug#769055: reportbug: AttributeError: 'NoneType' object has no attribute 'startswith'

Brian May brian at microcomaustralia.com.au
Tue Nov 11 00:54:05 UTC 2014

Package: reportbug
Version: 6.6.0
Severity: important

Not only did it crash, but there doesn't seem to be any sign of the temp
file any more, so I had to retype the bug report :-(

Report will be sent to "Debian Bug Tracking System" <submit at bugs.debian.org>
Submit this report on libapache2-mod-wsgi-py3 (e to edit)
[Y|n|a|c|e|i|l|m|p|q|d|t|s|?]? y
Traceback (most recent call last):
  File "/usr/bin/reportbug", line 2211, in <module>
  File "/usr/bin/reportbug", line 1081, in main
    return iface.user_interface()
  File "/usr/bin/reportbug", line 2203, in user_interface
  File "/usr/lib/python2.7/dist-packages/reportbug/submit.py", line 316, in
    msgname = os.path.expanduser(outfile) or ('/var/tmp/%s.bug' % package)
  File "/usr/lib/python2.7/posixpath.py", line 261, in expanduser
    if not path.startswith('~'):
AttributeError: 'NoneType' object has no attribute 'startswith'

Looking at the code:

elif outfile or not ((mta and os.path.exists(mta)) or smtphost):
    msgname = os.path.expanduser(outfile) or ('/var/tmp/%s.bug' % package)$

It would appear to be that outfile is None (not sure I understand why),
however the condition gets satisfied if a MTA is not installed or is
smtphost is defined.

It then crashes.

If this is an error condition, there needs to be a better error message,
and even better the temp file created by the editor should not get deleted.

Brian May <brian at microcomaustralia.com.au>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/reportbug-maint/attachments/20141111/22b6b385/attachment.html>

More information about the Reportbug-maint mailing list