GNU bug report logs - #44239
[PATCH] Python double-digit version detection broken

Previous Next

Package: automake;

Reported by: Patrik Novotny <panovotn <at> redhat.com>

Date: Mon, 26 Oct 2020 15:29:02 UTC

Severity: normal

Tags: patch

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44239 in the body.
You can then email your comments to 44239 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#44239; Package automake. (Mon, 26 Oct 2020 15:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Patrik Novotny <panovotn <at> redhat.com>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Mon, 26 Oct 2020 15:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Patrik Novotny <panovotn <at> redhat.com>
To: bug-automake <at> gnu.org
Subject: [PATCH] Python double-digit version detection broken
Date: Mon, 26 Oct 2020 14:00:43 +0100
[Message part 1 (text/plain, inline)]
Hi,

we have encountered an issue[1] with the python double-digit version
detection.

The used `sys.version[:3]` used in automake strips digits from the python
version. For example '3.10' is detected as '3.1'.

To fix this issue, `sys.version[:3]` is changed to `sys.version_info[:2]`
in the attached patch.

Version: 1.16.2
How to reproduce: Use automake with python 3.10 (or any double-digit
version)

More details can be found in the bugzilla below if needed.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1889732

--
Patrik Novotný
Associate Software Engineer
Red Hat
panovotn <at> redhat.com
[Message part 2 (text/html, inline)]
[0001-Fix-double-digit-python-version-detection.patch (application/x-patch, attachment)]

Information forwarded to bug-automake <at> gnu.org:
bug#44239; Package automake. (Mon, 26 Oct 2020 21:50:01 GMT) Full text and rfc822 format available.

Message #8 received at 44239 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: panovotn <at> redhat.com
Cc: 44239 <at> debbugs.gnu.org, miro <at> hroncok.cz
Subject: Re: bug#44239: [PATCH] Python double-digit version detection broken
Date: Mon, 26 Oct 2020 15:49:41 -0600
    https://bugzilla.redhat.com/show_bug.cgi?id=1889732

Well, I found the updated patch from Miro at
https://src.fedoraproject.org/rpms/automake/pull-request/3.patch,
which also fixes m4/python.m4, the crucial change being:

+-    [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
++    [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write('%d.%d' % sys.version_info[[:2]])"`])

I presume that's right, though I have no access to any python 3.10
system to check. 

The doc needs some more updating, it seems.  I will commit asap. If you
end up needing to make further changes, please let me know. --thanks, karl.





Information forwarded to bug-automake <at> gnu.org:
bug#44239; Package automake. (Mon, 26 Oct 2020 21:58:02 GMT) Full text and rfc822 format available.

Message #11 received at 44239 <at> debbugs.gnu.org (full text, mbox):

From: Miro Hrončok <miro <at> hroncok.cz>
To: Karl Berry <karl <at> freefriends.org>
Cc: 44239 <at> debbugs.gnu.org, panovotn <at> redhat.com
Subject: Re: bug#44239: [PATCH] Python double-digit version detection broken
Date: Mon, 26 Oct 2020 22:55:08 +0100
The patch is https://src.fedoraproject.org/fork/churchyard/rpms/automake/raw/f8af40fe1fa92a3ea0a1520a9d5f0797d0019f0f/f/automake-1.16.2-python-version-multiple-digits.patch

It includes doc update and the command line is:

$ python3.10 -c 'import sys; print("%u.%u" % sys.version_info[:2])'
3.10




Information forwarded to bug-automake <at> gnu.org:
bug#44239; Package automake. (Tue, 27 Oct 2020 21:37:02 GMT) Full text and rfc822 format available.

Message #14 received at 44239 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: miro <at> hroncok.cz
Cc: 44239 <at> debbugs.gnu.org, panovotn <at> redhat.com
Subject: Re: bug#44239: [PATCH] Python double-digit version detection broken
Date: Tue, 27 Oct 2020 15:36:50 -0600
    The patch is https://src.fedoraproject.org/fork/churchyard/rpms/automake/raw/f8af40fe1fa92a3ea0a1520a9d5f0797d0019f0f/f/automake-1.16.2-python-version-multiple-digits.patch

Thanks, I pushed it with some minor additional documentation updates.

    python3.10 -c 'import sys; print("%u.%u" % sys.version_info[:2])'

I also changed the invocation in python.m4 to be this (what you put in
t/python-vars.sh), instead of the sys.stdout.write('%d.%d') which you
had (following what was there before). Seemed better to have the two
invocations be exactly the same. At least, I couldn't discern any reason
why not, or any difference in the result, barring version numbers too
big to fit in signed integers :). --thanks, karl.




Reply sent to Karl Berry <karl <at> freefriends.org>:
You have taken responsibility. (Tue, 27 Oct 2020 21:37:02 GMT) Full text and rfc822 format available.

Notification sent to Patrik Novotny <panovotn <at> redhat.com>:
bug acknowledged by developer. (Tue, 27 Oct 2020 21:37:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#44239; Package automake. (Tue, 27 Oct 2020 21:48:02 GMT) Full text and rfc822 format available.

Message #22 received at 44239 <at> debbugs.gnu.org (full text, mbox):

From: Miro Hrončok <miro <at> hroncok.cz>
To: Karl Berry <karl <at> freefriends.org>
Cc: 44239 <at> debbugs.gnu.org, panovotn <at> redhat.com
Subject: Re: bug#44239: [PATCH] Python double-digit version detection broken
Date: Tue, 27 Oct 2020 22:47:39 +0100
I would normally use an f-string or str.format() but I wanted to keep
ancient Python version support. So I went with %-formatting. I've seen
%u somewhere in the codebase already instead of %d, so I've decided to
keep it consistent -- apparently I have failed and used %d in one of
the places anyway (habbit, I guess), thanks for catching it, Karl.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 Nov 2020 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.