[New-bugs-announce] [issue11250] 2to3 truncates files at formfeed character

Christoph Gohlke report at bugs.python.org
Sun Feb 20 00:57:25 CET 2011


New submission from Christoph Gohlke <cgohlke at uci.edu>:

Running Tools/Scripts/2to3.py on Python 3.2rc3 or 2.7.1 for Windows on a file that contains a formfeed character (0x0C, <FF>) results in a truncated file. 

E.g. a file (attached) with the content

print 1
<FF>
print 2

is incorrectly refactored:

@@ -1,4 +1,1 @@
-print 1
-
-
-print 2
+print(1)


Python 2.6.6 and 3.1.3 correctly refactor the file:

-print 1
+print(1)
 <FF>
-print 2
+print(2)

----------
files: formfeedbug.py
messages: 128885
nosy: cgohlke
priority: normal
severity: normal
status: open
title: 2to3 truncates files at formfeed character
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file20800/formfeedbug.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11250>
_______________________________________


More information about the New-bugs-announce mailing list