Movatterモバイル変換
[0]ホーム
[Python-Dev] test_pep277 vs Win98
Tim Peterstim.one@comcast.net
Sat, 05 Oct 2002 18:17:31 -0400
[martin@v.loewis.de]> If you take this definition, it will be very difficult to determine> whether this should be True or False on Unix. On some systems, it will> depend on environment variables whether these are valid file names or> not.Then set it to False without thinking on Unix, until Unix systems evolve tothe point where Unicode strings are generally useful file paths.> Also, the test tests whether os.listdir(u".") returns Unicode file> names - which is currently never the case on Unix, even though they> may support the file names as arguments. So should I add> os.path.listdir_with_unicode_argument_returns_unicode as well?I would consider that more unhelpul logic-chopping <wink>. I would hopethat intuitive listdir() behavior was part of what it *means* for Unicodestrings to be generally useful as file paths. If no version of Unixsupports that (yet), fine, then no version of Unix can (yet) claimsupports_unicode_filenames in this sense.> Furthermore, how would I implement os.path.supports_unicode_filenames> for ntpath? It seems that something must be exported from os.This sounds like, for now, whether a platform supports this or not is amatter of hand-forcing a config symbol, where only a few Windows flavors arecurrently justified in saying "yup, works here".> ...> PEP 277 gives Python applications access to all file names on Windows> NT; this is a property unique to NT: on all other systems, you can> access all file names using byte strings. For the test to test that> feature, we need to chose a set of file names that are cannot all be> represented as byte strings, simultaneously.I still see nothing specific to Windows in this, apart from that NT+ appearto be, for now, the only OSes that support Unicode strings as file paths ina generally useful way. The crux of PEP 277 from my POV is not that Windowssupports this, but that some flavors of Windows allow "direct access to allfile names, including those that are not representable using the currentlocale", and using Unicode. That's a Good Idea, and I doubt Microsoft has apatent on it. The PEP also mentions that it seems *plausible* to implementthis for Win9x using VFAT-32, so it's again not a "am I on Windows, and ifso which flavor?" issue at heart.
[8]ページ先頭