Re: Encoding of file names

2005-12-10 Thread Martin v. Löwis
Tom Anderson wrote: >> This is a fact, but it is not a key thing. Of course Windows is >> applying a non-roundtrippable character encoding. What else could it do? > > > Well, i'm no great thinker, but i'd say that errors should never pass > silently, and that in the face of ambiguity, one shoul

Re: Encoding of file names

2005-12-09 Thread Tom Anderson
On Fri, 9 Dec 2005, "Martin v. Löwis" wrote: Tom Anderson wrote: Isn't the key thing that Windows is applying a non-roundtrippable character encoding? This is a fact, but it is not a key thing. Of course Windows is applying a non-roundtrippable character encoding. What else could it do? W

Re: Encoding of file names

2005-12-09 Thread Martin v. Löwis
Tom Anderson wrote: > Isn't the key thing that Windows is applying a non-roundtrippable > character encoding? This is a fact, but it is not a key thing. Of course Windows is applying a non-roundtrippable character encoding. What else could it do? > Windows, however, maps that name to the > 8-bi

Re: Encoding of file names

2005-12-09 Thread utabintarbo
Part of the reason (I think) is that our CAD/Data Management system (which produces the aforementioned .MODEL files) substitutes (stupidly, IMNSHO) non-printable characters for embedded spaces in file names. This is part of what leads to my consternation here. And yeah, Windows isn't helping matte

Re: Encoding of file names

2005-12-09 Thread Tom Anderson
On Thu, 8 Dec 2005, "Martin v. Löwis" wrote: utabintarbo wrote: Fredrik, you are a God! Thank You^3. I am unworthy For all those who followed this thread, here is some more explanation: Apparently, utabintarbo managed to get U+2592 (MEDIUM SHADE, a filled 50% grayish square) and U+2524 (B

Re: Encoding of file names

2005-12-08 Thread Martin v. Löwis
utabintarbo wrote: > Fredrik, you are a God! Thank You^3. I am unworthy > > I believe that may do the trick. Here is the results of running your > code: For all those who followed this thread, here is some more explanation: Apparently, utabintarbo managed to get U+2592 (MEDIUM SHADE, a filled 5

Re: Encoding of file names

2005-12-08 Thread utabintarbo
Fredrik, you are a God! Thank You^3. I am unworthy I believe that may do the trick. Here is the results of running your code: >>> DIR = os.getcwd() >>> files = os.listdir(DIR) >>> file = files[-1] >>> file 'L07JS41C.04389525AA.QTR\xa6INR.E\xa6C-P.D11.081305.P2.KPF.model' >>> print file L07JS41C.

Re: Encoding of file names

2005-12-08 Thread Fredrik Lundh
"utabintarbo" wrote: > I am trying to programatically access files created on an IBM AIX > system, stored on a Sun OS 5.8 fileserver, through a samba-mapped drive > on a Win32 system. Not confused? OK, let's move on... ;-) > > When I ask for an os.listdir() of a relevant directory, I get filenames

Re: Encoding of file names

2005-12-08 Thread Kent Johnson
utabintarbo wrote: > Here is my situation: > > I am trying to programatically access files created on an IBM AIX > system, stored on a Sun OS 5.8 fileserver, through a samba-mapped drive > on a Win32 system. Not confused? OK, let's move on... ;-) > > When I ask for an os.listdir() of a relevant d

Re: Encoding of file names

2005-12-08 Thread Peter Otten
utabintarbo wrote: > I am trying to programatically access files created on an IBM AIX > system, stored on a Sun OS 5.8 fileserver, through a samba-mapped drive > on a Win32 system. Not confused? OK, let's move on... ;-) > > When I ask for an os.listdir() of a relevant directory, I get filenames

Re: Encoding of file names

2005-12-08 Thread Peter Hansen
utabintarbo wrote: > I am trying to programatically access files created on an IBM AIX > system, stored on a Sun OS 5.8 fileserver, through a samba-mapped drive > on a Win32 system. Not confused? OK, let's move on... ;-) > > When I ask for an os.listdir() of a relevant directory, I get filenames >

Encoding of file names

2005-12-08 Thread utabintarbo
Here is my situation: I am trying to programatically access files created on an IBM AIX system, stored on a Sun OS 5.8 fileserver, through a samba-mapped drive on a Win32 system. Not confused? OK, let's move on... ;-) When I ask for an os.listdir() of a relevant directory, I get filenames with em