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: external shell command executed twice in ctypes.util._get_soname
Type: performance Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: martin.panter, pitrou, python-dev, sijinjoseph
Priority: normal Keywords: patch

Created on 2011-05-09 21:09 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
12045.patch sijinjoseph, 2011-05-16 20:14 Patch for issue #12045 review
Messages (6)
msg135650 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-05-09 21:09
It seems `cmd` is executed twice, for no obvious reason, in the following code:
http://hg.python.org/cpython/file/2d4ef202d4ed/Lib/ctypes/util.py#l129
msg136125 - (view) Author: Sijin Joseph (sijinjoseph) Date: 2011-05-16 20:14
Attaching patch.

Removed the second call to os.popen and used the dump variable that was read earlier as the argument to re.search.
msg136861 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-25 16:17
New changeset c540b18b00b9 by Antoine Pitrou in branch 'default':
Issue #12045: Avoid duplicate execution of command in ctypes.util._get_soname().
http://hg.python.org/cpython/rev/c540b18b00b9
msg136864 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-05-25 16:24
Committed, thank you!
msg265238 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-05-10 11:21
The same code is in Python 2. It was introduced by Issue 4861 (r68487).
msg265240 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-05-10 11:41
New changeset 0b15b5371c07 by Antoine Pitrou in branch '2.7':
Issue #12045: Avoid duplicate execution of command in ctypes.util._get_soname().
https://hg.python.org/cpython/rev/0b15b5371c07
History
Date User Action Args
2022-04-11 14:57:17adminsetgithub: 56254
2016-05-10 11:41:51python-devsetmessages: + msg265240
2016-05-10 11:21:26martin.pantersetnosy: + martin.panter

messages: + msg265238
versions: + Python 2.7
2011-05-25 16:24:19pitrousetstatus: open -> closed
resolution: fixed
messages: + msg136864

stage: needs patch -> resolved
2011-05-25 16:17:31python-devsetnosy: + python-dev
messages: + msg136861
2011-05-16 20:14:39sijinjosephsetfiles: + 12045.patch

nosy: + sijinjoseph
messages: + msg136125

keywords: + patch
2011-05-16 19:35:45sijinjosephsetnosy: - sijinjoseph
2011-05-11 11:39:53sijinjosephsetnosy: + sijinjoseph
2011-05-09 21:09:06pitroucreate