This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author abarry
Recipients abarry, berker.peksag, bethard, ezio.melotti, fabian_b, vstinner
Date 2016-06-20.15:33:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1466436791.17.0.499950110823.issue27356@psf.upfronthosting.co.za>
In-reply-to
Content
(Berker beat me to it, but posting anyway since it is more detailed)

Backslashes are escape characters, and "\b" is treated as "\x08". Invalid combinations (e.g. "\A", "\D"...) automatically escape the backslash, but you shouldn't rely on this behaviour - as you can see, it can break in various ways.

To fix your issue, you can either:

- Add a single 'r' before the beginning of your string, i.e. r"C:\Users\Anwender\Desktop\Test\blub.txt" - the 'r' prefix tells Python to automatically escape all backslashes it sees (unless it's at the end of the string, in that case you need to escape it yourself).

- Escape each backslash in your string, i.e. "C:\\Users\\Anwender\\Desktop\\Test\\blub.txt" - the extra backslash tells Python "treat this as a literal backslash, don't use it to escape anything"

- Since this is Windows, you can use forward slashes, i.e. "C:/Users/Anwnder/Desktop/Test/blub.txt", it will work all the same for Python.
History
Date User Action Args
2016-06-20 15:33:11abarrysetrecipients: + abarry, bethard, vstinner, ezio.melotti, berker.peksag, fabian_b
2016-06-20 15:33:11abarrysetmessageid: <1466436791.17.0.499950110823.issue27356@psf.upfronthosting.co.za>
2016-06-20 15:33:11abarrylinkissue27356 messages
2016-06-20 15:33:10abarrycreate