[issue22636] avoid using a shell in ctypes.util: replace os.popen with subprocess

Martin Panter report at bugs.python.org
Mon Jun 13 23:53:45 EDT 2016


Martin Panter added the comment:

An Open Indiana buildbot failed. The old code let the shell print any errors about missing programs to /dev/null, so I will change the subprocess calls to handle OSError.

======================================================================
ERROR: setUpModule (ctypes.test.test_loading)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/export/home/buildbot/32bits/3.5.cea-indiana-x86/build/Lib/ctypes/test/test_loading.py", line 19, in setUpModule
    libc_name = find_library("c")
  File "/export/home/buildbot/32bits/3.5.cea-indiana-x86/build/Lib/ctypes/util.py", line 238, in find_library
    return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
  File "/export/home/buildbot/32bits/3.5.cea-indiana-x86/build/Lib/ctypes/util.py", line 145, in _get_soname
    stderr=subprocess.DEVNULL)
  File "/export/home/buildbot/32bits/3.5.cea-indiana-x86/build/Lib/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/export/home/buildbot/32bits/3.5.cea-indiana-x86/build/Lib/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/ccs/bin/dump'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22636>
_______________________________________


More information about the Python-bugs-list mailing list