classification
Title: build_py_2to3 does not convert when there was an error in the last run
Type: behavior Stage: resolved
Components: Distutils, Distutils2 Versions: Python 3.2, Python 3.3, 3rd party
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: Arfrever, alexis, eric.araujo, simohe, tarek
Priority: normal Keywords:

Created on 2011-11-01 21:22 by simohe, last changed 2020-10-22 19:46 by eric.araujo. This issue is now closed.

Messages (5)
msg146807 - (view) Author: simohe (simohe) Date: 2011-11-01 21:22
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.
msg146945 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-03 16:36
> When I use build_py_2to3 and there is an error while converting a
> file with 2to3, convert is skipped on the next run.

I think build should stop with an error message if 2to3 fails.  Do you agree?
msg146975 - (view) Author: simohe (simohe) Date: 2011-11-03 20:28
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.)
msg148047 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-21 14:41
> It does stop with an error message.  But when I reinvoke the command, converting is
> skipped (because the file is already copied).
Then that’s the bug: In case of error, the file in the build dir should be removed.

By the way, I think this was not reported before because people probably edit the file when there is a 2to3 error, and so it is detected as modified and then copied again.
msg379329 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2020-10-22 19:46
Closing this.  It was not fixed when it would have been useful, and people mostly use other tools that distutils for packaging and 2to3 for transition.
History
Date User Action Args
2020-10-22 19:46:10eric.araujosetstatus: open -> closed
resolution: wont fix
messages: + msg379329

stage: test needed -> resolved
2011-11-21 14:41:24eric.araujosetassignee: tarek -> eric.araujo
type: behavior
messages: + msg148047
2011-11-05 22:42:41Arfreversetnosy: + Arfrever
2011-11-03 20:28:02simohesetmessages: + msg146975
2011-11-03 16:36:50eric.araujosetassignee: tarek
components: + Distutils, Distutils2, - Build, 2to3 (2.x to 3.x conversion tool)
versions: + 3rd party, Python 3.2, Python 3.3, - Python 3.1
nosy: + eric.araujo, alexis, tarek

messages: + msg146945
stage: test needed
2011-11-01 21:34:37simohesettype: behavior -> (no value)
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
2011-11-01 21:32:45simohesetcomponents: + 2to3 (2.x to 3.x conversion tool)
2011-11-01 21:22:19simohecreate