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 vstinner
Recipients Matt.Mackall, durin42, georg.brandl, gregory.p.smith, martin.panter, ncoghlan, pitrou, python-dev, r.david.murray, serhiy.storchaka, vstinner
Date 2016-03-15.11:44:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1458042241.44.0.649372364158.issue24230@psf.upfronthosting.co.za>
In-reply-to
Content
I don't understand the rationale to add new functions using bytes filenames.

IMHO it's a bad practice to pass bytes filenames to write portable code. On Windows, bytes lead to strange bugs: os.listdir(bytes) gives you filenames which don't exist when a filename cannot be encoded to the ANSI code page.

On UNIX, os.fsencode() and os.fsdecode() allows you to convert filenames between unicode and bytes. It provides nice properties like os.fsencode(os.fsdecode(value))==value where value is bytes. No need to add new APIs, use existing APIs an use os.fsencode() and os.fsdecode() on top of them.

Bytes filenames are deprecated on Windows since Python 3.2. The new os.scandir() function doesn't support bytes for example, it's a deliberate choice.

Maybe I missed an important technical issue?
History
Date User Action Args
2016-03-15 11:44:01vstinnersetrecipients: + vstinner, georg.brandl, gregory.p.smith, ncoghlan, pitrou, durin42, r.david.murray, python-dev, martin.panter, Matt.Mackall, serhiy.storchaka
2016-03-15 11:44:01vstinnersetmessageid: <1458042241.44.0.649372364158.issue24230@psf.upfronthosting.co.za>
2016-03-15 11:44:01vstinnerlinkissue24230 messages
2016-03-15 11:44:01vstinnercreate