On Sat, 9 May 2015 06:39 am, zljubisic...@gmail.com wrote: > Thanks for clarifying. > Looks like the error message was wrong.
No, the error message was right. Your problem was that you used backslashes in *Python program code*, rather than reading it from a text file. In Python, a string-literal containing \U is an escape sequence which expects exactly 8 hexadecimal digits to follow: py> path = '~~~~\U000000a7~~~~' py> print(path) ~~~~ยง~~~~ If you don't follow the \U with eight hex digits, you get an error: py> path = '~~~~\Users~~~~' File "<stdin>", line 1 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 4-6: truncated \UXXXXXXXX escape This applies only to string literals in code. For data read from files, backslash \ is just an ordinary character which has no special meaning. > On windows ntfs I had a file name more than 259 characters which is widows > limit. After cutting file name to 259 characters everything works as it > should. If I cut file name to 260 characters I get the error from subject > which is wrong. What you describe is impossible. You cannot possibly get a SyntaxError at compile time because the path is too long. You must have made other changes at the same time, such as using a raw string r'C: ... \Users\ ...'. -- Steven -- https://mail.python.org/mailman/listinfo/python-list