Marc-Andre Lemburg <m...@egenix.com> added the comment:

Éric Araujo wrote:
> 
> Éric Araujo <mer...@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.

----------
nosy: +lemburg
title: distutils command build_scripts fails with UnicodeDecodeError -> 
distutils command build_scripts fails with      UnicodeDecodeError

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10419>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to