shutil.copy Problem

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue Mar 27 03:34:24 EDT 2007


In <mailman.5648.1174965082.32031.python-list at python.org>, David Nicolson
wrote:

> Hi,
> 
> I wasn't exactly sure where to send this, I don't know if it is a bug  
> in Python or not. This is rare, but it has occurred a few times and  
> seems to be reproducible for those who experience it.
> 
> Examine this code:
>  >>> try:
>  >>>     shutil.copy("/file.xml","/Volumes/External/file.xml")
>  >>> except Exception, err:
>  >>>     print sys.exc_info()[0]
>  >>>     print err
> 
> This is the output:
> exceptions.UnicodeDecodeError
> 'ascii' codec can't decode byte 0xd6 in position 26: ordinal not in  
> range(128)]
> 
> What could the possible cause of this be? Shouldn't shutil simply be  
> reading and writing the bytes and not character decoding them?

Do you really get this error from the code above or just in the real
program?  Are the paths hard coded in the real program too?

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list