Commit Graph

22 Commits

Author SHA1 Message Date
Victor Stinner
eb063011ab Issue #22636: Avoid using a shell in the ctypes.util module
Replace os.popen() with subprocess.Popen.

If the "gcc", "cc" or "objdump" command is not available, the code was
supposed to raise an OSError exception. But there was a bug in the code. The
shell code returns the exit code 10 if the required command is missing, and the
code tries to check for the status 10. The problem is that os.popen() doesn't
return the exit code directly, but a status which should be processed by
os.WIFEXITED() and os.WEXITSTATUS(). In practice, the exception was never
raised. The OSError exception was not documented and ctypes.util.find_library()
is expected to return None if the library is not found.

Based on patch by Victor Stinner.
2014-10-16 09:42:45 +02:00
Matthias Klose
9aabaccb76 Issue #7356: ctypes.util: Make parsing of ldconfig output locale independent.
Previous fix was only made to dead and removed code.
2010-03-15 13:46:04 +00:00
Martin Panter
f45c1755c3 Remove PEP 291 compatibility requirements for ctypes and modulefinder
https://mail.python.org/pipermail/python-dev/2016-May/144502.html
2016-05-14 07:25:37 +00:00
Antoine Pitrou
ec62130655 Issue #12045: Avoid duplicate execution of command in ctypes.util._get_soname().
Patch by Sijin Joseph.
2011-05-25 18:17:25 +02:00
Meador Inge
ae21a8a555 Issue #24114: Fix an uninitialized variable in ctypes.util.
The bug only occurs on SunOS when the ctypes implementation searches
for the `crle` program.  Patch by Xiang Zhang.  Tested on SunOS by
Kees Bos.
2016-04-30 21:56:59 -05:00
Serhiy Storchaka
5312a7f912 Avoid deprecation warnings. 2015-01-31 11:27:06 +02:00
doko@ubuntu.com
96645cc4ff - Issue #17754: Make ctypes.util.find_library() independent of the locale. 2013-05-15 15:46:11 +02:00
Benjamin Peterson
f727c31133 fix find_library on Solaris (closes #5289) 2013-02-03 19:25:11 -05:00
Meador Inge
ff337ccd4b Issue #13979: Fix ctypes.util.find_library ldconfig regex 2012-02-13 22:22:06 -06:00
Matthias Klose
19f9810a1a Try harder on issue #7356: ctypes.util: Make parsing of ldconfig output
independent of the locale. Set LC_ALL=C too.
2010-09-15 13:01:19 +00:00
Matthias Klose
358e7ff36b - Issue #7356: ctypes.util: Make parsing of ldconfig output independent of
the locale.
2010-03-15 13:42:23 +00:00
Eric Smith
84da0905e4 Per the discussion in issue6882, backport the try/finally work that was done to the py3k version (mostly in r59477, I think). 2009-10-22 20:13:14 +00:00
Thomas Heller
a57773e483 Fix Issue #4875: find_library can return directories instead of files
(on win32)
2009-05-05 18:55:47 +00:00
Matthias Klose
43723e2ad8 - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
2009-01-10 17:00:42 +00:00
Thomas Heller
95ba13fa85 Issue 1793: Add ctypes.util.find_msvcrt() function (on Windows). 2008-05-16 20:06:31 +00:00
Thomas Heller
a7f49f733b ctypes.util.find_library uses dump(1) instead of objdump(1) on Solaris.
Fixes issue #1777530; will backport to release25-maint.
2007-09-14 19:40:35 +00:00
Thomas Heller
d059e7b423 patch #1610795: BSD version of ctypes.util.find_library, by Martin
Kammerhofer.

release25-maint backport candidate, but the release manager has to
decide.
2007-01-12 20:17:34 +00:00
Thomas Heller
2bdf29ec28 Fix #1521375. When running with root priviledges, 'gcc -o /dev/null'
did overwrite /dev/null.  Use a temporary file instead of /dev/null.
2006-07-13 17:01:14 +00:00
Thomas Heller
c2da994585 Add pep-291 compatibility markers. 2006-06-12 20:56:48 +00:00
Neal Norwitz
6aaccc6b55 Fix errors found by pychecker 2006-06-11 08:35:14 +00:00
Thomas Heller
e43a0fcc9d Add missing svn properties. 2006-05-12 18:16:03 +00:00
Thomas Heller
6ff67ef096 Merge in changes from ctypes 0.9.9.6 upstream version. 2006-04-21 16:51:04 +00:00