In <[EMAIL PROTECTED]>, Alex S wrote:

> os.walk return hex excape sequence inside a files name, and when i try
> to feed it back to os.remove i get 
> 
> OSError: [Errno 22] Invalid argument:
> 'C:\\Temp\\?p?\xbfS\xbf\xac?G\xaba ACDSee \xbb?a??n a???\xac\xb5\xbfn.exe'

There is no hex escape in that file name, just in the representation you
get in the error message.  The `repr()` form of a string contains just
ASCII, everything outside printable ASCII characters is printed as hex
escape so you can see what the string actually contains without being
interpreted by the shell, IDE or wherever the string is displayed.

How does the real file name look like?

Ciao,
        Marc 'BlackJack' Rintsch

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to