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 lemburg
Recipients Arfrever, alexis, eric.araujo, hagen, lemburg, mgorny, tarek, vstinner
Date 2011-04-28.08:20:32
SpamBayes Score 2.3314684e-15
Marked as misclassified No
Message-id <4DB92345.3010105@egenix.com>
In-reply-to <1303947537.31.0.43411102261.issue10419@psf.upfronthosting.co.za>
Content
Éric Araujo wrote:
> 
> Éric Araujo <merwok@netwok.org> added the comment:
> 
> I’m not sure how I feel about using surrogateescape.  The distutils source is very similar across 2.7, 3.1, 3.2 and default, especially after the Great Revert and freeze last year to restore buggy-but-known behavior while the distutils2 project was created and allowed to fix things and break stuff.  Haypo added a fix using surrogateescape in 3.2, so it couldn’t be backported to all stable branches.  You may say that at least it was fixed in one version, which is something good.  I don’t know if I’d prefer to apply the patch (if a test is provided) or to raise an exception instead of silently changing behavior.

I think this patch should be applied to all 3.x versions, since
all of them are affected by the same problem: reading a file with
unknown encoding, adding a shebang and writing it back again.

Python shouldn't really care about the script file's encoding and
since the "surrogateescape" error handler is the only way to
more or less cleanly get around the problem, I'm +1 on adding the
patch to the 3.x series.

I don't think this is needed for 2.7, since Python 2.x's open()
doesn't care about the file encoding anyway.
History
Date User Action Args
2011-04-28 08:20:33lemburgsetrecipients: + lemburg, vstinner, tarek, eric.araujo, hagen, Arfrever, alexis, mgorny
2011-04-28 08:20:33lemburglinkissue10419 messages
2011-04-28 08:20:32lemburgcreate