srilatha44 / threepress

Automatically exported from code.google.com/p/threepress
Other
0 stars 0 forks source link

Exception.__unicode__ is not defined in Python 2.5 #165

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Running tests raises an unexpected Exception:

    return _add_data_to_document(request, document, open(temp_file), form)
  File "/Users/jens/Documents/devel/threepress/bookworm/../bookworm/library/views.py", line 
498, in _add_data_to_document
    _email_errors_to_admin(e, data, document)
  File "/Users/jens/Documents/devel/threepress/bookworm/../bookworm/library/views.py", line 
657, in _email_errors_to_admin
    email = EmailMessage(u'[bookworm-error] %s (book=%s)' % (exception.__unicode__(), 
document.name),
AttributeError: 'InvalidEpubException' object has no attribute '__unicode__'

----------------------------------------------------------------------
Ran 119 tests in 135.593s

Original issue reported on code.google.com by jens.quade on 27 Aug 2009 at 9:32

GoogleCodeExporter commented 9 years ago

Original comment by jens.quade on 27 Aug 2009 at 11:00

GoogleCodeExporter commented 9 years ago
Fixed in [r870].

Original comment by jens.quade on 28 Aug 2009 at 11:41

GoogleCodeExporter commented 9 years ago
out of interest, would it be a bad thing to simply add a __unicode__ routine to 
the Exception that just returns 
str(self)?

Original comment by steven.m...@gmail.com on 30 Aug 2009 at 11:57

GoogleCodeExporter commented 9 years ago
Would work for subclasses of Exception (not for the builtin Exception class 
itself), and only if the message 
contains only ascii characters.

Original comment by jens.quade on 31 Aug 2009 at 12:02