On Mon, Oct 6, 2008 at 5:12 PM, Glenn Linderman <[EMAIL PROTECTED]> wrote: > On approximately 10/3/2008 11:57 PM, came the following characters from the > keyboard of Adam Olsen: >> On Fri, Oct 3, 2008 at 10:14 PM, Glenn Linderman <[EMAIL PROTECTED]> >> wrote: >>> Alternative 3: Portable programs use the Unicode file interfaces on >>> Windows, >>> and the bytes file interfaces on Posix, and deal with the differences, as >>> described for Windows only in alternative 1 and Posix only in alternative >>> 2. >>> >>> Alternative 4: Someone implements an object that does alternative 3 under >>> the covers, and every one will wish Alternative 1 & 2 didn't even exist. >>> The only reasons not to do this seem to be (a) Python 2.6 is already >>> released and doesn't have it, (b) Python 3.0 would slip its schedule even >>> more, (c) it's a significant chunk of code to implement and get right in >>> a >>> hurry. >>> >> >> Nope, not possible. The closest we can do is "bytes with implicit >> conversion to unicode", but (a) implicit conversion is much less >> maintainable (zen, etc), (b) it STILL doesn't work. You still can't >> round-trip a bad file name through a unicode API. >> > > Not clear if you meant Alternative 3, 4 or both were not possible. > > The object would provide methods for manipulating the path names, > particularly the ability to extract a path from one object and a file from > another and combine them, somehow. So programs wouldn't have to perform > these sorts of manipulations themselves, so they wouldn't care if they are > done on Posix and bytes and on Windows as Unicode.
But "Unicode" on windows is invalid. It shares all the same problems UTF-8b does, but worse as a correct UTF-16 codec would forbid exporting it. We'd need to invent a UTF-16b to save it, or simulate one manually. If the binary APIs on windows emitted raw UTF-16 bytes then we merely need to add a os.sepb equal to os.sep.encode('UTF-16') and you've got your portable low-level API. You don't need a path object. -- Adam Olsen, aka Rhamphoryncus _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com