[issue13316] build_py_2to3 does not execute when there was an error before

2011-11-01 Thread simohe

New submission from simohe :

When I use build_py_2to3 and there is an error while converting a file with 
2to3, convert is skipped on the next run.

The reason is that build_module in build_py_2to3 (in module 
distutils.command.build_py) only appends the file for converting when it is 
newly copied. Something safer should be used.
The simplest possibility is to always convert.

--
components: Build
messages: 146807
nosy: simohe
priority: normal
severity: normal
status: open
title: build_py_2to3 does not execute when there was an error before
type: behavior
versions: Python 3.1

___
Python tracker 
<http://bugs.python.org/issue13316>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13317] building with 2to3 generates wrong import paths because build_ext is run after build_py

2011-11-01 Thread simohe

New submission from simohe :

We need build_ext before build_py. Otherwise, when 2to3 is called (in 
build_py), it will not find ext modules, thinking that those modules are global 
and, consequently, making a mess, now that all module imports are global.

--
components: 2to3 (2.x to 3.x conversion tool), Build
messages: 146808
nosy: simohe
priority: normal
severity: normal
status: open
title: building with 2to3 generates wrong import paths because build_ext is run 
after build_py

___
Python tracker 
<http://bugs.python.org/issue13317>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13316] build_py_2to3 does not execute when there was an error before

2011-11-01 Thread simohe

Changes by simohe :


--
components: +2to3 (2.x to 3.x conversion tool)

___
Python tracker 
<http://bugs.python.org/issue13316>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13316] build_py_2to3 does not convert when there was an error in the last run

2011-11-01 Thread simohe

Changes by simohe :


--
title: build_py_2to3 does not execute when there was an error before -> 
build_py_2to3 does not convert when there was an error in the last run
type: behavior -> 

___
Python tracker 
<http://bugs.python.org/issue13316>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13316] build_py_2to3 does not convert when there was an error in the last run

2011-11-03 Thread simohe

simohe  added the comment:

It does stop with an error message.
But when I reinvoke the command, converting is skipped (because the file is 
already copied). No error message is raised and the build continues with the 
remaining jobs (build_*).
It should reexecute at least the failing conversion and those after them. (And 
when the error still is there, it should reraise it.)

--

___
Python tracker 
<http://bugs.python.org/issue13316>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13317] building with 2to3 generates wrong import paths because build_ext is run after build_py

2011-11-03 Thread simohe

simohe  added the comment:

fix_imports rewrites the import statements to local or global. When a python 
module loads a local extension module, this import statement should be 
converted to a local import (from . import extensionmodule). But when the 
extension module is not built yet, fix_imports does not find them (no file 
named extenstionmodule.[so|sl]). So it suggests a global import (import 
extensionmodule).


The original comment is a slightly modified version of this here:
http://selenic.com/hg/file/afc02adf4ded/contrib/setup3k.py#l223


short summary:

build.sub_commands in distutils.command.build should list "build_ext" before 
"build_py".
lib2to3.fixes.fix_import will write global instead of local import statements 
else.

--
assignee:  -> tarek
components: +Distutils -Build
nosy: +tarek

___
Python tracker 
<http://bugs.python.org/issue13317>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12864] 2to3 creates illegal code on import a.b inside a package

2011-08-30 Thread simohe

New submission from simohe :

When the current module is in a package and imports submodules, the following 
lines are converted to illegal code.

-import sub.subsub
+from . import sub.subsub

-import sub, sub.subsub, sub2
+from . import sub, sub.subsub, sub2

A valid alternative:

-import sub.subsub
+from .sub import subsub as _dummy

-import sub, sub.subsub, sub2
+from . import sub, sub2\nfrom .sub import subsub as _dummy

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 143237
nosy: simohe
priority: normal
severity: normal
status: open
title: 2to3 creates illegal code on import a.b inside a package
versions: Python 2.6, Python 3.1

___
Python tracker 
<http://bugs.python.org/issue12864>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com