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 serhiy.storchaka
Recipients amaury.forgeotdarc, eric.araujo, ezio.melotti, jkloth, larry, loewis, r.david.murray, serhiy.storchaka, techtonik
Date 2012-12-14.16:52:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1355503920.55.0.319472528698.issue16656@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks, Anatoly. I see an actual bug. FindFirstFile and FindNextFile return broken name if file unicode name can't be represented in current codepage.

I don't know what is perfect solution for this issue.

On 2.7 we can decode listdir() argument to unicode and then encode result names to str with sys.getfilesystemencoding() only if it is possible. Therefore listdir() with str argument will return unicode for non-encodable names. This should not make many new problems in addition to those which 2.7 already have with Unicode.

But on 3.x listdir() with bytes argument can returns only bytes objects. I don't know what to do with non-encodable names in such case. Perhaps an exception should be raised. Fortunately listdir() with bytes argument is rarely used on 3.x.
History
Date User Action Args
2012-12-14 16:52:00serhiy.storchakasetrecipients: + serhiy.storchaka, loewis, amaury.forgeotdarc, larry, techtonik, jkloth, ezio.melotti, eric.araujo, r.david.murray
2012-12-14 16:52:00serhiy.storchakasetmessageid: <1355503920.55.0.319472528698.issue16656@psf.upfronthosting.co.za>
2012-12-14 16:52:00serhiy.storchakalinkissue16656 messages
2012-12-14 16:52:00serhiy.storchakacreate