Replace os.popen() with subprocess.check_output() in the platform module:
* platform.uname() (its _syscmd_ver() helper function) now redirects
stderr to DEVNULL.
* Remove platform.DEV_NULL.
* _syscmd_uname() and _syscmd_file() no longer catch AttributeError.
The "except AttributeError:" was only needed in Python 2, when
os.popen() was not always available. In Python 3,
subprocess.check_output() is always available.
Join 3 pools in these tests:
* test.test_multiprocessing_spawn.WithProcessesTestPool.test_context
* test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback
select() calls are retried on EINTR (per PEP 475). However, if a
timeout was provided and the deadline has passed after running the
signal handlers, rlist, wlist and xlist should be cleared since select(2)
left them unmodified.
When running test_bdb.py as a script, `import test_module` would be
importing the existing Lib/test/test_modules.py instead of the
tempcwd/test_module.py module which was dynamically created by
test_bdb.py itself.
* posixpath.expanduser() now returns the input path unchanged if
the HOME environment variable is not set and pwd.getpwuid() raises
KeyError (the current user identifier doesn't exist in the password
database).
* Add test_no_home_directory() to test_site.
* bpo-31572: Get rid of PyObject_HasAttrString() in ctypes.
* Fix error handling for _pack_.
* Don't silence errors when look up in a dict.
* Use _PyObject_LookupAttrId().
* More changes.
platform.libc_ver() now uses os.confstr('CS_GNU_LIBC_VERSION') if
available and the *executable* parameter is not set. The default
value of the libc_ver() *executable* parameter becomes None.
Quick benchmark on Fedora 29:
python3 -m perf command ./python -S -c 'import platform; platform.libc_ver()'
94.9 ms +- 4.3 ms -> 33.2 ms +- 1.4 ms: 2.86x faster (-65%)
On Travis CI, FTP tests of test_urllib2net randomly fail with "425
Security: Bad IP connecting".
test.pythoninfo now also logs TRAVIS environment variable.
Only platform._syscmd_file() uses subprocess. Move subprocess import
inside this function to reduce the number of imports at Python
startup.
Remove also warnings import which is no longer needed.
When using link time optimizations, the -flto flag is passed to
BASECFLAGS, which makes it propagate to distutils. Those flags
should be reserved for the interpreter and the stdlib extension
modules only, thus moving those flags to CFLAGS_NODIST.
Fixes `loop.add_writer` and `loop.add_signal_handler` method documentation to correctly reference the callback parameter from method signature.
https://bugs.python.org/issue35395
* PyInit_time() now returns NULL if an exception is raised.
* Rename PyInit_timezone() to init_timezone(). "PyInit_" prefix is
a special prefix for function initializing a module.
init_timezone() doesn't initialize a module and the function is not
exported.