This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients aronacher, docs@python, ncoghlan, pitrou, serhiy.storchaka, vstinner
Date 2013-07-25.13:02:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1374757323.5.0.676167714782.issue18534@psf.upfronthosting.co.za>
In-reply-to
Content
Switching this to a docs bugs, since http://docs.python.org/3/library/functions.html#open doesn't mention this behaviour at all, and http://docs.python.org/3/library/io.html#io.FileIO.name only notes the fact it may be a file descriptor without mentioning the str/bytes discrepancy.

So, at a bare minimum, we need to clearly describe this behaviour in the docs. We may also want to explicitly point out that using os.fsdecode(name) before passing it to open() will ensure that the name attribute is set to a string rather than a bytes object.
History
Date User Action Args
2013-07-25 13:02:03ncoghlansetrecipients: + ncoghlan, pitrou, vstinner, aronacher, docs@python, serhiy.storchaka
2013-07-25 13:02:03ncoghlansetmessageid: <1374757323.5.0.676167714782.issue18534@psf.upfronthosting.co.za>
2013-07-25 13:02:03ncoghlanlinkissue18534 messages
2013-07-25 13:02:03ncoghlancreate