[issue4723] os.path.basename error on directory names with numbers

2008-12-22 Thread Martin v. Löwis
Martin v. Löwis added the comment: > Of course my example was not that trivial, since i do sort of > directory-walking, and i get the value passed over. And in Windows it is > with backslash! Not necessarily. Windows supports forward slashes as path separators just as well. > Ok, i will check

[issue4723] os.path.basename error on directory names with numbers

2008-12-22 Thread Klemens Häckel
Klemens Häckel added the comment: Of course my example was not that trivial, since i do sort of directory-walking, and i get the value passed over. And in Windows it is with backslash! Ok, i will check my code, wherever i use os.path.basename and change it to process as raw string. Thank You _

[issue4723] os.path.basename error on directory names with numbers

2008-12-22 Thread Martin v. Löwis
Martin v. Löwis added the comment: Tim is right; \0 is an octal escape (for the byte with the ordinal value 0). -- nosy: +loewis resolution: -> invalid status: open -> closed ___ Python tracker ___

[issue4723] os.path.basename error on directory names with numbers

2008-12-22 Thread Tim Golden
Tim Golden added the comment: You need to use raw strings or to use forward-slashes in your pathnames: r"c:\downloads\hacking\0812logcompress" or "c:/downloads/hacking/0812logcompress" The sequence \0 has a special meaning in strings, introducing an octal escape, I think. -- nosy: +

[issue4723] os.path.basename error on directory names with numbers

2008-12-22 Thread Klemens Häckel
New submission from Klemens Häckel : I am using python for some backup tasks, and recently i found a problem whe i have certain directory names. Probably the problem is only in windows, however i would like You to know. I verified the same behaviour in (WindowsXP, spanish, SP3) using Python 2.5.2