Package: python3.2
Version: 3.2.1~rc1-1
Severity: normal

The ‘2to3’ tool in Python 2.6 and 2.7 correctly handle the whitespace
character U+000C FORM FEED.

=====
$ printf "print 'foo'\nprint 'bar'\n\f\nprint 'bar'\n" > foo.py
$ wc -l foo.py
4 foo.py

$ 2to3-2.7 --write --fix print foo.py
RefactoringTool: Refactored foo.py
--- foo.py      (original)
+++ foo.py      (refactored)
@@ -1,5 +1,5 @@
-print 'foo'
-print 'bar'
+print('foo')
+print('bar')


-print 'bar'
+print('bar')
RefactoringTool: Files that were modified:
RefactoringTool: foo.py

$ wc -l foo.py
4 foo.py
=====

The resulting file contains all the lines from the original; the diff
doesn't remove any lines except to replace each one.


However, the ‘2to3’ tool in Python 3.2 truncates all content from the
U+000C to the end of the file:

=====
$ printf "print 'foo'\nprint 'bar'\n\f\nprint 'baz'\n" > foo.py
$ wc -l foo.py
4 foo.py

$ 2to3-3.2 --write --fix print foo.py
RefactoringTool: Refactored foo.py
--- foo.py      (original)
+++ foo.py      (refactored)
@@ -1,5 +1,2 @@
-print 'foo'
-print 'bar'
-
-
-print 'bar'
+print('foo')
+print('bar')
RefactoringTool: Files that were modified:
RefactoringTool: foo.py

$ wc -l foo.py
1 foo.py
=====

The resulting file contains only the corresponding lines before the
U+000C, and all remaining lines are removed with no replacement.

Python in all these versions allows U+000C as a whitespace character;
the ‘2to3’ tool should treat it as in Python 2.7.


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (900, 'stable')
Architecture: powerpc (ppc64)

Kernel: Linux 2.6.38-2-powerpc64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_AU.utf8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python3.2 depends on:
ii  libbz2-1.0                   1.0.5-6     high-quality block-sorting file co
ii  libc6                        2.13-7      Embedded GNU C Library: Shared lib
ii  libdb5.1                     5.1.25-10   Berkeley v5.1 Database Libraries [
ii  libncursesw5                 5.9-1       shared libraries for terminal hand
ii  libreadline6                 6.2-2       GNU readline and history libraries
ii  libsqlite3-0                 3.7.6.3-1   SQLite 3 shared library
ii  mime-support                 3.51-1      MIME files 'mime.types' & 'mailcap
ii  python3.2-minimal            3.2.1~rc1-1 A minimal subset of the Python lan

python3.2 recommends no packages.

Versions of packages python3.2 suggests:
ii  binutils              2.21.52.20110606-2 The GNU assembler, linker and bina
ii  python3.2-doc         3.2.1~rc1-1        Documentation for the high-level o
pn  python3.2-profiler    <none>             (no description available)

-- no debconf information



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to