classification
Title: Building from a fresh clone breaks on Parser/asdl_c.py
Type: behavior Stage: resolved
Components: Build Versions: Python 3.4, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: Arfrever, amaury.forgeotdarc, barry, christian.heimes, ezio.melotti, georg.brandl, haypo, loewis, python-dev, trent
Priority: normal Keywords:

Created on 2012-09-11 21:13 by barry, last changed 2012-09-30 19:54 by ezio.melotti. This issue is now closed.

Messages (6)
msg170344 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2012-09-11 21:13
After a fresh clone, configure && make fails due to a fairly obvious bug in the code.  Note that if you `hg revert --all`, configure && make will succeed, probably because the timestamps get updated enough to fool make.

@resist[~/projects/python:1043]% hg clone ssh://hg@hg.python.org/releasing/3.3.0
[...]
@resist[~/projects/python:1044]% cd 3.3.0/
@resist[~/projects/python/3.3.0:1045]% ./configure && make
[...]

gcc -pthread -c -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes    -I. -I./Include    -DPy_BUILD_CORE -o Python/_warnings.o Python/_warnings.c
./Parser/asdl_c.py -h ./Include ./Parser/Python.asdl
./Parser/asdl_c.py -c ./Python ./Parser/Python.asdl
Error visitingSum([Constructor(Load, []), Constructor(Store, []), Constructor(Del, []), Constructor(AugLoad, []), Constructor(AugStore, []), Constructor(Param, [])], [])
not all arguments converted during string formatting
Traceback (most recent call last):
  File "/home/barry/projects/python/3.3.0/Parser/asdl.py", line 309, in visit
    meth(object, *args)
  File "./Parser/asdl_c.py", line 1043, in visitSum
    self.simpleSum(sum, name)
  File "./Parser/asdl_c.py", line 1067, in simpleSum
    self.emit("default:" % name, 2)
TypeError: not all arguments converted during string formatting
make: *** [Python/Python-ast.c] Error 1
msg170346 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-09-11 23:04
It's really puzzling that this has ever worked; the buggy code has been there since 2008, yet apparently executed successfully many times since.
msg170396 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2012-09-12 15:59
It's most probably related to issue15801: if 'name' is an instance of  Python-defined class, then it was considered as a mapping...
msg170685 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2012-09-18 22:29
See also #15964.
msg171665 - (view) Author: Roundup Robot (python-dev) Date: 2012-09-30 19:49
New changeset 8f07ab82de92 by Ezio Melotti in branch '2.7':
#15923: fix a mistake in asdl_c.py that resulted in a TypeError after 2801bf875a24 (see #15801).
http://hg.python.org/cpython/rev/8f07ab82de92

New changeset cb988d601803 by Ezio Melotti in branch '3.2':
#15923: fix a mistake in asdl_c.py that resulted in a TypeError after 2801bf875a24 (see #15801).
http://hg.python.org/cpython/rev/cb988d601803

New changeset e7a55a393a80 by Ezio Melotti in branch '3.3':
#15923: merge with 3.2.
http://hg.python.org/cpython/rev/e7a55a393a80

New changeset b392a39970bb by Ezio Melotti in branch 'default':
#15923: merge with 3.3.
http://hg.python.org/cpython/rev/b392a39970bb
msg171666 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-09-30 19:54
This is now fixed.

self.emit("default:" % name, 2) worked until #15801 got fixed,
Since asdl_c.py is executed using the system Python, this was failing only when the system Python included the fix.
History
Date User Action Args
2012-09-30 19:54:05ezio.melottisetstatus: open -> closed

resolution: fixed

assignee: ezio.melotti
stage: resolved
versions: + Python 2.7, Python 3.2, Python 3.4
nosy: + ezio.melotti
messages: + msg171666
components: + Build
type: behavior
2012-09-30 19:49:05python-devsetnosy: + python-dev
messages: + msg171665
2012-09-18 22:29:57hayposetnosy: + haypo
messages: + msg170685
2012-09-12 15:59:04amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg170396
2012-09-12 04:18:28Arfreversetnosy: + Arfrever
2012-09-12 04:16:26trentsetnosy: + trent
2012-09-11 23:04:28loewissetmessages: + msg170346
2012-09-11 22:09:54christian.heimessetnosy: + christian.heimes
2012-09-11 21:13:58barrycreate