Join 3 pools in these tests:
* test.test_multiprocessing_spawn.WithProcessesTestPool.test_context
* test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback
(cherry picked from commit 388c8c208d)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
Moreover, "python3 -m test test_eintr -v" now avoids redirecting
stdout/stderr to a pipe, the child process inherits stdout/stderr
from the parent.
(cherry picked from commit aa8ae904ad)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
Add a missing word `as` in `as well as an`.
Linkify `threading.Thread`.
(cherry picked from commit 40a61da40d)
Co-authored-by: Matt Wheeler <m@funkyhat.org>
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.
(cherry picked from commit 7f52415a6d)
Co-authored-by: Oran Avraham <252748+oranav@users.noreply.github.com>
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.
(cherry picked from commit 54fd45505b)
Co-authored-by: Alex H <1884912+lajarre@users.noreply.github.com>
* 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.
(cherry picked from commit f2f4555d82)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
On Travis CI, FTP tests of test_urllib2net randomly fail with "425
Security: Bad IP connecting".
test.pythoninfo now also logs TRAVIS environment variable.
(cherry picked from commit c11b3b19a5)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-35296: make install now installs the internal API (GH-10665)
make install now also installs the internal API: Include/internal/*.h
header files.
(cherry picked from commit f653fd4d95)
* Windows installer now also install Include/internal/
The Windows installer (MSI) now also install header files of the
Include/internal/ subdirectory.
The warnings module now suggests to enable tracemalloc if the source
is specified, tracemalloc module is available, but tracemalloc is not
tracing memory allocations.
(cherry picked from commit 2c07c493d2)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
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.
(cherry picked from commit f92c7aa1ae)
Co-authored-by: stratakis <cstratak@redhat.com>
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
(cherry picked from commit 1747334794)
Co-authored-by: Naglis <naglis@users.noreply.github.com>
* bpo-35373: Fix PyInit_timezone() error handling
PyInit_timezone() now returns -1 at exit if an exception is raised.
Check also explicitly PyUnicode_DecodeLocale() and Py_BuildValue()
errors.
* bpo-35373: Fix PyInit_time() error handling (GH-10865)
* 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.
(cherry picked from commit 3bb150d814)
Also refactor the call recording imolementation and add some notes
about its limitations.
(cherry picked from commit 8ca0fa9d2f)
Co-authored-by: Chris Withers <chris@withers.org>
* Add create_autospec with partial function returned in getattr
* Use self.assertFalse instead of assert
* Use different names and remove object
(cherry picked from commit c667b094ae)
Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
get_gmtoff() now returns time_t instead of int to fix the following
Visual Studio warning:
Modules\timemodule.c(1183): warning C4244: 'return':
conversion from 'time_t' to 'int', possible loss of data
(cherry picked from commit 503ce5c482)
* bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826)
Modify asyncio tests to utilize the certificates from the test directory
instead of its own set, as they are the same and with each update they had
to be updated as well.
(cherry picked from commit b062ba77b6)
* bpo-35352: Cleanup test_asyncio/utils.py (GH-10831)
'here' variable is no longer needed.
(cherry picked from commit 7212148c95)
Fix an undefined behaviour in the pthread implementation of
PyThread_start_new_thread(): add a function wrapper to always return
NULL.
Add pythread_callback struct and pythread_wrapper() to thread_pthread.h.
(cherry picked from commit 9eea6eaf23)
Co-authored-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
testAccept() and testRecv() of test_socket.NonBlockingTCPTests have a
race condition: time.sleep() is used as a weak synchronization
primitive and the tests fail randomly on slow buildbots.
Use a reliable threading.Event to fix these tests.
Other changes:
* Replace send() with sendall()
* Expect specific BlockingIOError rather than generic OSError
* Add a timeout to select() in testAccept() and testRecv()
* Use addCleanup() to close sockets
* Use assertRaises()
(cherry picked from commit ebd5d6d6e6)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-34605, libregrtest: Rename --slaveargs to --worker-args (GH-9099)
Rename also run_tests_slave() to run_tests_worker().
(cherry picked from commit 012f5b968a)
* bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10150)
(cherry picked from commit 9724348b43)
* test_regrtest: remove unused threading import
PyType_GetFlags() return type is unsigned long, not long.
(cherry picked from commit 9fbcfc08e5)
Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
test_eintr no longer fails if the signal handler has not been called.
(cherry picked from commit 2956bffbc0)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
The "busy loops" of test_process_time() and test_thread_time() are
not reliable and fail randomly on Windows: remove them.
(cherry picked from commit 48498dd57f)
Co-authored-by: Victor Stinner <vstinner@redhat.com>