[issue5093] 2to3 with a pipe on non-ASCII script

2009-12-17 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixed in r76871. -- nosy: +benjamin.peterson, collinwinter resolution: -> fixed status: open -> closed ___ Python tracker ___ __

[issue5093] 2to3 with a pipe on non-ASCII script

2009-07-31 Thread Matthew Barnett
Matthew Barnett added the comment: I was thinking that if you're converting a Python 2.x script to Python 3.x using 2to3 then also encoding the new script in UTF-8 might be a good idea. -- ___ Python tracker __

[issue5093] 2to3 with a pipe on non-ASCII script

2009-07-31 Thread James Abbatiello
James Abbatiello added the comment: In what case(s) do you propose the output to be encoded in UTF-8? If output is to a terminal and that terminal is set to Latin-1 or cp437 or whatever then outputting UTF-8 in that case will only show garbage characters to the user. If output is to a file the

[issue5093] 2to3 with a pipe on non-ASCII script

2009-07-31 Thread Matthew Barnett
Matthew Barnett added the comment: I'd like to suggest that it the output could/should be encoded in UTF-8. -- nosy: +mrabarnett ___ Python tracker ___ __

[issue5093] 2to3 with a pipe on non-ASCII script

2009-07-29 Thread James Abbatiello
James Abbatiello added the comment: The --no-diffs option was recently added which looks like a good workaround. Here's an attempt at a solution. If sys.stdout has an encoding set then use that, just as is being done now. If there is no encoding (implying "ascii") then use the encoding of the

[issue5093] 2to3 with a pipe on non-ASCII script

2009-01-28 Thread STINNER Victor
STINNER Victor added the comment: Example of workaround: don't write the patch if the option -w is used. I don't need the patch if I choosed to modify the files in place. -- keywords: +patch Added file: http://bugs.python.org/file12887/2to3_write.patch

[issue5093] 2to3 with a pipe on non-ASCII script

2009-01-28 Thread STINNER Victor
New submission from STINNER Victor : If Python output is redirected to a pipe, sys.stdout encoding is ASCII. So "2to3 script.py|cat" will write the patch in ASCII. If the script contains a non-ASCII character, 2to3 fails with: ... File ".../lib2to3/refactor.py", line 238, in refactor_file