Re: PEP on path module for standard library
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: PEP on path module for standard library

From: Neil Hodgson <nyamatongwe+thunder@gmail.com>
Date: Sat Jul 23 2005 - 02:49:32 CEST

Scott David Daniels:

> Isn't it even worse than this?
> On Win2K & XP, don't the file systems have something to do with the
> encoding? So D: (a FAT drive) might naturally be str, while C:
> (an NTFS drive) might naturally be unicode.

    This is generally safe as Windows is using unicode internally and
provides full-fidelity access to the FAT drive using unicode strings.
You can produce failures if you try to create files with names that can
not be represented but you would see a similar failure with byte string
access.

> Even worse, would be a
> path that switches in the middle (which it might do if we get to a
> ZIP file or use the newer dir-in-file file systems.

    If you are promoting from byte strings with a known encoding to
unicode path objects then this should always work.

    Neil
Received on Thu Sep 29 17:06:58 2005