Error copying a file

Stephen Boulet stephendotboulet at motorola_._com
Wed Apr 14 17:21:18 EDT 2004


I know that the name of this file is somewhat pathological, but this if 
weird:

 >>> print myfile
E:\Fritz Reiner\Rimsky-Korsakov--Scheherazade.Debussy--La Mer\01 
Symphonic Suite after "A Thousand and One Nights" - The Sea and Sinbad's 
Ship.ogg

 >>> os.path.isfile(myfile)
True
 >>> os.path.getsize(myfile)
12321468L
 >>> shutil.copy2(myfile,r'D:\foo.ogg')
Traceback (most recent call last):
   File "<input>", line 1, in ?
   File "C:\Python23\Lib\shutil.py", line 82, in copy2
     copyfile(src, dst)
   File "C:\Python23\Lib\shutil.py", line 37, in copyfile
     fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: 'E:\\Fritz 
Reiner\\Rimsky-Korsakov--Scheherazade.Debussy--La Mer\\01 Symphonic 
Suite after "A Thousand and One Nights" - The Sea and Sinbad\'s Ship.ogg'
 >>> shutil.copy(myfile,r'D:\foo.ogg')
Traceback (most recent call last):
   File "<input>", line 1, in ?
   File "C:\Python23\Lib\shutil.py", line 71, in copy
     copyfile(src, dst)
   File "C:\Python23\Lib\shutil.py", line 37, in copyfile
     fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: 'E:\\Fritz 
Reiner\\Rimsky-Korsakov--Scheherazade.Debussy--La Mer\\01 Symphonic 
Suite after "A Thousand and One Nights" - The Sea and Sinbad\'s Ship.ogg'

Must have CD, btw, for you Fritz Reiner fans ... and yes I do own the cd ;)

Stephen



More information about the Python-list mailing list