Chinese character error

John Deas john.deas at
Fri Feb 8 10:29:26 CET 2008


I made a small script to recursively copy files from a directory tree
to an exportDir only if they have an mp3 extension :

for root, dirs, files in a:
	for currFile in files:
		pathCurrFile=os.path.join(root, currFile)
			print pathCurrFile

The problem is that I get stuck with files containing name in
Chinese :

Traceback (most recent call last):
  File "/cygdrive/c/Documents and Settings/vku/Mes documents/Ma
Tunes Music/", line 21, in <module>
  File "/usr/lib/python2.5/", line 80, in copy
    copyfile(src, dst)
  File "/usr/lib/python2.5/", line 46, in copyfile
    fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: '/cygdrive/c/Documents
and Setting
s/vku/Mes documents/Ma musique/iTunes/iTunes Music/Podcasts/Learn
Chinese - Chin
esePod/785 Advanced - ????.mp3'

I am using python on cygwin, so could this be the source of the error,
and is there a way to fix this ?

More information about the Python-list mailing list