A
aberry
I am facing an error on Unicode decoding of path if it contain a folder/file
name starting with character 'u' .
Here is what I did in IDLE
1. >>> fp = "C:\\ab\\anil"
2. >>> unicode(fp, "unicode_escape")
3. u'C:\x07b\x07nil'
4. >>> fp = "C:\\ab\\unil"
5. >>> unicode(fp, "unicode_escape")
6.
7. Traceback (most recent call last):
8. File "<pyshell#41>", line 1, in <module>
9. unicode(fp, "unicode_escape")
10. UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position
5-9: end of string in escape sequence
11. >>>
Not sure whether I am doing something wrong or this is as designed behavior
..
any help appreciated
Rgds,
aberry
name starting with character 'u' .
Here is what I did in IDLE
1. >>> fp = "C:\\ab\\anil"
2. >>> unicode(fp, "unicode_escape")
3. u'C:\x07b\x07nil'
4. >>> fp = "C:\\ab\\unil"
5. >>> unicode(fp, "unicode_escape")
6.
7. Traceback (most recent call last):
8. File "<pyshell#41>", line 1, in <module>
9. unicode(fp, "unicode_escape")
10. UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position
5-9: end of string in escape sequence
11. >>>
Not sure whether I am doing something wrong or this is as designed behavior
..
any help appreciated
Rgds,
aberry