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 eric.smith
Recipients Tito.Bouzout, eric.smith, ezio.melotti, mrabarnett
Date 2014-04-17.14:50:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397746233.46.0.987484386143.issue21283@psf.upfronthosting.co.za>
In-reply-to
Content
In addition, you probably want "\\server\path\to" to be a raw string, too. That way, the backslashes are not given special meaning. Notice the difference in output between these two:

>>> "\\server\path\to".strip(r'"\'<>') 
'server\\path\to'
>>> r"\\server\path\to".strip(r'"\'<>') 
'server\\path\\to'

In the first one, '\t' is being treated as a tab character, in the second one you see a backslash followed by a 't'.

My rule of thumb is: any time you have a string with a filename containing backslashes, you want it to be a raw string.
History
Date User Action Args
2014-04-17 14:50:33eric.smithsetrecipients: + eric.smith, ezio.melotti, mrabarnett, Tito.Bouzout
2014-04-17 14:50:33eric.smithsetmessageid: <1397746233.46.0.987484386143.issue21283@psf.upfronthosting.co.za>
2014-04-17 14:50:33eric.smithlinkissue21283 messages
2014-04-17 14:50:33eric.smithcreate