New submission from Michael Foord <mich...@voidspace.org.uk>: >>> try: ... open('flooble') ... except Exception as e: ... pass ... [39343 refs] >>> str(e) "[Errno 2] No such file or directory: 'flooble'" [39345 refs] >>> unicode(e) u"(2, 'No such file or directory')"
The Unicode representation of an IOError has no information about the file or directory name. This is a regression from 2.5. Would be nice to backport a fix to 2.6 if we can. This bit docutils - and can happen as a side-effect of interpolating into a Unicode string with %s. The filename information is lost from the error report. ---------- components: IO keywords: 26backport messages: 92525 nosy: michael.foord severity: normal status: open title: IOError has no __unicode__ method - and loses information versions: Python 2.6, Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6890> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com