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 Jonathan.Rogers
Recipients Caio.Romao, Dima.Tisnek, Jonathan.Rogers, eric.araujo, roger.serwy
Date 2012-01-01.04:09:36
SpamBayes Score 2.5293524e-08
Marked as misclassified No
Message-id <1325390978.63.0.544571687415.issue12930@psf.upfronthosting.co.za>
In-reply-to
Content
I don't think reindent.py should change any bytes inside string literals since it can't know anything about what those strings mean or how they'll be used by the program at run time. Unfortunately, it starts out by unconditionally calling the .expandtabs() method on each input line, so tab characters are lost. The only change to a string literal I can imagine that would be safe is to replace tab characters with '\t'.

I am trying to use reindent.py on Python source files which include triple-quoted, multi-line string literals containing makefile and Python snippets. In both cases, running reindent.py changes the meaning of of that contained in the literal.
History
Date User Action Args
2012-01-01 04:09:39Jonathan.Rogerssetrecipients: + Jonathan.Rogers, roger.serwy, eric.araujo, Dima.Tisnek, Caio.Romao
2012-01-01 04:09:38Jonathan.Rogerssetmessageid: <1325390978.63.0.544571687415.issue12930@psf.upfronthosting.co.za>
2012-01-01 04:09:37Jonathan.Rogerslinkissue12930 messages
2012-01-01 04:09:37Jonathan.Rogerscreate