[issue2428] 2to3 deletes # comments before "from __future__ import with_statement"

Bruce Frederiksen report at bugs.python.org
Wed Mar 19 22:00:03 CET 2008


New submission from Bruce Frederiksen <dangyogi at gmail.com>:

2to3, svn rev 61623.  To reproduce this error:

$ cat <<! > foobar.py
# line 1
# line 2

from __future__ import with_statement
import sys
!
$ 2to3 -w foobar.py
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: ws_comma
--- foobar.py (original)
+++ foobar.py (refactored)
@@ -1,5 +1,2 @@
-# line 1
-# line 2
 
-from __future__ import with_statement
 import sys
RefactoringTool: Files that were modified:
RefactoringTool: foobar.py
$ cat foobar.py

import sys
$

----------
assignee: collinwinter
components: 2to3 (2.x to 3.0 conversion tool)
messages: 64098
nosy: collinwinter, dangyogi
severity: normal
status: open
title: 2to3 deletes # comments before "from __future__ import with_statement"
type: behavior
versions: Python 2.6

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2428>
__________________________________


More information about the Python-bugs-list mailing list