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 serhiy.storchaka
Recipients r.david.murray, serhiy.storchaka, underrun
Date 2013-08-08.17:31:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375983067.05.0.514891322657.issue18679@psf.upfronthosting.co.za>
In-reply-to
Content
> this doesn't work if you use the wrong quote. without introspecting the data in e you can't reliably choose whether to use "'%s'" '"%s"' '"""%s"""' or "'''%s'''".

Indeed.

> and again tools other than python will run into escaped quotes in the data which may cause problems.

Then use s.translate() or re.sub() for encoding.

> when i execute this i get a traceback

Sorry, it should be

e.encode('latin1', 'backslashreplace').decode('unicode-escape').
History
Date User Action Args
2013-08-08 17:31:07serhiy.storchakasetrecipients: + serhiy.storchaka, r.david.murray, underrun
2013-08-08 17:31:07serhiy.storchakasetmessageid: <1375983067.05.0.514891322657.issue18679@psf.upfronthosting.co.za>
2013-08-08 17:31:07serhiy.storchakalinkissue18679 messages
2013-08-08 17:31:06serhiy.storchakacreate