Author xtreak
Recipients Yugi, xtreak
Date 2019-08-24.15:07:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1566659275.7.0.21940549284.issue37939@roundup.psfhosted.org>
In-reply-to
Content
I guess '\f' translates to \x0c and using raw string helps with this.

>>> ord('\f')
12
>>> '\f'
'\x0c'
>>> var = "d:\stuff\morestuff\furtherdown\THEFILE.txt"
>>> var
'd:\\stuff\\morestuff\x0curtherdown\\THEFILE.txt'
>>> print(os.path.normpath(var))
d:\stuff\morestuff
                  urtherdown\THEFILE.txt
>>> os.path.normpath(var)
'd:\\stuff\\morestuff\x0curtherdown\\THEFILE.txt'

# Use raw string

>>> var = r"d:\stuff\morestuff\furtherdown\THEFILE.txt"
>>> var
'd:\\stuff\\morestuff\\furtherdown\\THEFILE.txt'
>>> print(os.path.normpath(var))
d:\stuff\morestuff\furtherdown\THEFILE.txt
>>> os.path.normpath(var)
'd:\\stuff\\morestuff\\furtherdown\\THEFILE.txt'

# Or escape back slashes

>>> var = "d:\\stuff\\morestuff\\furtherdown\\THEFILE.txt"
>>> var
'd:\\stuff\\morestuff\\furtherdown\\THEFILE.txt'
>>> print(os.path.normpath(var))
d:\stuff\morestuff\furtherdown\THEFILE.txt
History
Date User Action Args
2019-08-24 15:07:55xtreaksetrecipients: + xtreak, Yugi
2019-08-24 15:07:55xtreaksetmessageid: <1566659275.7.0.21940549284.issue37939@roundup.psfhosted.org>
2019-08-24 15:07:55xtreaklinkissue37939 messages
2019-08-24 15:07:55xtreakcreate