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 r.david.murray
Recipients QuantumTim, facundobatista, georg.brandl, gwideman, r.david.murray, v+python
Date 2011-03-11.21:09:09
SpamBayes Score 1.8449417e-07
Marked as misclassified No
Message-id <1299877750.76.0.0572943698953.issue1271@psf.upfronthosting.co.za>
In-reply-to
Content
I think perhaps the language in the language reference is a bit misleading.  The purpose of the raw string algorithm is that any characters in the string be copied literally into the string object.  That is, \" "escapes" the " not so that you can write r"\"", but so that the string object produced by that literal (or by the literal r'\"') contains the two characters \".

So, it is certainly true that raw string will *not* be changed to make \ not escape quotes.

I can't remember where I read this, but the reason that a trailing \ is invalid has to do with the way the parser parses strings/raw strings.  So any alternate "more raw" string type would have to contend with the same parser issues that lead to the exiting restrictions on raw strings.

Unless someone wants to do a deep dive into the parser and figure out why things are they way they are and how to fix it, I think this issue should be reclosed.  Note that even if a solution can be found, if it significantly complicates the parser it will probably be rejected.  And I suspect it would, otherwise things probably wouldn't work the way they currently do.  However, perhaps someone can spot a clever solution that was overlooked in the original implementation.
History
Date User Action Args
2011-03-11 21:09:10r.david.murraysetrecipients: + r.david.murray, georg.brandl, facundobatista, QuantumTim, v+python, gwideman
2011-03-11 21:09:10r.david.murraysetmessageid: <1299877750.76.0.0572943698953.issue1271@psf.upfronthosting.co.za>
2011-03-11 21:09:10r.david.murraylinkissue1271 messages
2011-03-11 21:09:09r.david.murraycreate