[Pythonmac-SIG] Problems with file names

Pierre Thibault p.thibault at bigfoot.com
Sat Nov 6 23:05:56 CET 2004


Hello,

I have a little problem with the Python script I wrote. I am unable to 
treat some file names containing accentued characters or special 
characters like '. I use the os.walk() generator to traverse my 
hierarchy of files. I then use commands.getstatusoutput('md5 ' + "'" + 
fileName + "'") to execute the md5 command on the files I want.

This is working well for most of my files but not for file names 
containing accentued characters or special characters like ' as I said 
before. Is there a way to reformat fineName to avoid these errors? Is 
there a special Unix command that I don't know to do that?

Any help or idea on how to solve this problem would be appreciated.

Regards.

---------------------
Pierre



More information about the Pythonmac-SIG mailing list