This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Py_GetBuildInfo() truncates when there are many hg tags
Type: behavior Stage: resolved
Components: Build Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: SilentGhost, georg.brandl, nadeem.vawda, pitrou, python-dev, scott.dial
Priority: normal Keywords: patch

Created on 2011-03-09 08:10 by scott.dial, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue11450.diff nadeem.vawda, 2011-03-09 11:12 Fix truncation of build info string.
Messages (5)
msg130432 - (view) Author: Scott Dial (scott.dial) Date: 2011-03-09 08:10
I'm not sure if it's intended to be a supported workflow, but I personally have come to like using "mq" for projects where I am an outsider submitting small changes as patches. However, this appears to be a broken workflow due to way getbuildinfo module choose to limit the buildinfo string to 50 characters:

$ hg qnew dummy-patch
$ echo "/* dummy change */" >> Modules/getbuildinfo.c
$ ./python -c 'import sys; print(sys.version)' 
3.3a0 (dummy-patch qbase qtip tip:191f047a07b4+, Mar  9 ) 
[GCC 4.4.5]

This breaks the platform module and therefore breaks the regrtest code, which makes it a show-stopper for using mq to manage your workflow. Is there any reason that length of buildinfo can't be chosen at compile-time based on the sizeof(HGTAG)?
msg130446 - (view) Author: Nadeem Vawda (nadeem.vawda) * (Python committer) Date: 2011-03-09 11:12
I don't seem to be able to reproduce the failure in test_platform. Nevertheless, the behaviour is broken. Here's a patch that should fix it without allocating too much extra space.
msg130447 - (view) Author: Nadeem Vawda (nadeem.vawda) * (Python committer) Date: 2011-03-09 11:18
Ah, now I see - the code that fails isn't test_platform, it's the regrtest code that prints out the version info at the beginning of the test results. This doesn't get displayed when you explicitly tell regrtest what tests to run ("./python [...] -m test test_platform"), which is why I didn't see it at first.
msg130450 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-03-09 11:54
New changeset 0f9e5042907c by Antoine Pitrou in branch '3.1':
Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when
http://hg.python.org/cpython/rev/0f9e5042907c

New changeset 605c74139754 by Antoine Pitrou in branch '3.2':
Merge fix for issue #11450
http://hg.python.org/cpython/rev/605c74139754

New changeset 1e00b161f5f5 by Antoine Pitrou in branch 'default':
Merge fix for issue #11450
http://hg.python.org/cpython/rev/1e00b161f5f5

New changeset a7412744822d by Antoine Pitrou in branch '2.7':
Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when
http://hg.python.org/cpython/rev/a7412744822d
msg130451 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-03-09 11:56
Thanks you for the patch! Fixed now.
History
Date User Action Args
2022-04-11 14:57:14adminsetgithub: 55659
2011-03-09 11:56:24pitrousetstatus: open -> closed

versions: + Python 3.1, Python 2.7, Python 3.2
nosy: + pitrou

messages: + msg130451
resolution: fixed
stage: needs patch -> resolved
2011-03-09 11:54:11python-devsetnosy: + python-dev
messages: + msg130450
2011-03-09 11:18:38nadeem.vawdasetnosy: georg.brandl, scott.dial, nadeem.vawda, SilentGhost
messages: + msg130447
2011-03-09 11:12:13nadeem.vawdasetfiles: + issue11450.diff

nosy: + nadeem.vawda
messages: + msg130446

keywords: + patch
2011-03-09 10:53:37SilentGhostsetnosy: + SilentGhost
2011-03-09 10:45:35pitrousetnosy: + georg.brandl
stage: needs patch
type: enhancement -> behavior

versions: + Python 3.3
2011-03-09 08:10:17scott.dialcreate