| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Multiple threads iterating over a file can corrupt the file's internal readahead
buffer resulting in crashes. To fix this, cache buffer state thread-locally for
the duration of a file_iternext call and only update the file's internal state
after reading completes.
No attempt is made to define or provide "reasonable" semantics for iterating
over a file on multiple threads. (Non-crashing) races are still
present. Duplicated, corrupt, and missing data will happen.
|
|
|
|
|
| |
(GH-1767) (#3549)
(cherry picked from commit 1de4705d00168afa8c5b6741af02e21fc609af58)
|
|
|
|
|
|
| |
fork_wait.py tests now joins threads, to not leak running threads in
the background.
(cherry picked from commit c99d41f9c0304fcf06550515c3db55f93a629e9e)
|
|
|
| |
(cherry picked from commit 71fe8c00f6e2eda39d90c225c5f7635268cc4653)
|
|
|
|
|
| |
is not a dictionary. (GH-3485). (#3493)
(cherry picked from commit 252033d50effa08046ac34fcc406bc99796ab88b)
|
|
|
|
|
| |
ttk.OptionMenu radiobuttons weren't unique
between instances of OptionMenu.
(cherry picked from commit a568e5273382a5dca0c27274f7d8e34c41a87d4d)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-29136: Add TLS 1.3 support
TLS 1.3 introduces a new, distinct set of cipher suites. The TLS 1.3
cipher suites don't overlap with cipher suites from TLS 1.2 and earlier.
Since Python sets its own set of permitted ciphers, TLS 1.3 handshake
will fail as soon as OpenSSL 1.1.1 is released. Let's enable the common
AES-GCM and ChaCha20 suites.
Additionally the flag OP_NO_TLSv1_3 is added. It defaults to 0 (no op) with
OpenSSL prior to 1.1.1. This allows applications to opt-out from TLS 1.3
now.
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit cb5b68abdeb1b1d56c581d5b4d647018703d61e3)
|
|
|
| |
(cherry picked from commit 8204b903683f9e0f037ccfaa87622716019914d7)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-31339: Rewrite time.asctime() and time.ctime()
Backport and adapt the _asctime() function from the master branch to
not depend on the implementation of asctime() and ctime() from the
external C library. This change fixes a bug when Python is run using
the musl C library.
* bound checks for time.asctime()
* bound checks for time.strftime()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-27448: Work around a gc.disable race condition in subprocess.
This works around a gc.isenabled/gc.disable race condition in the 2.7
subprocess module by using a lock for the critical section. It'll
prevent multiple simultaneous subprocess launches from winding up with
gc remaining disabled but it can't fix the ultimate problem: gc enable
and disable is a global setting and a hack.
Users are *strongly encouraged* to use subprocess32 from PyPI instead
of the 2.7 standard library subprocess module. Mixing threads with
subprocess is a recipie for disaster otherwise even with "fixes" to
ameliorate common issues like this.
* Add a blurb!
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-25674: remove sha256.tbs-internet.com ssl test (#3297)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 002d64039b60c1a9289f981fe73a5cf91d082136)
* [2.7] bpo-25674: remove sha256.tbs-internet.com ssl test (GH-3297)
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 002d64039b60c1a9289f981fe73a5cf91d082136)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-31) (#3242)
[2.7] bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (GH-31)
Ctypes currently produces wrong pep3118 type codes for several types.
E.g. memoryview(ctypes.c_long()).format gives "<l" on 64-bit platforms,
but it should be "<q" instead for sizeof(c_long) == 8
The problem is that the '<>' endian specification in the struct syntax
also turns on the "standard size" mode, which makes type characters have
a platform-independent meaning, which does not match with the codes used
internally in ctypes. The struct module format syntax also does not
allow specifying native-size non-native-endian items.
This commit adds a converter function that maps the internal ctypes
codes to appropriate struct module standard-size codes in the pep3118
format strings. The tests are modified to check for this..
(cherry picked from commit 07f1658aa09f6798793c473c72b2951b7fefe220)
|
| |
|
|\ |
|
| | |
|
|/
|
|
| |
to parse non-args. (#3213)
|
|
|
|
| |
Use self.addCleanup(self.server.stop) to stop the HTTP server. Some
tests didn't stop the server like test_https().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-30871: Add test.pythoninfo (#3075)
* Add Lib/test/pythoninfo.py: script collecting various informations
about Python to help debugging test failures.
* regrtest: remove sys.hash_info and sys.flags from header.
* Travis CI, Appveyor: run pythoninfo before tests
(cherry picked from commit b907abc88589f7bea52c5afe172ececc6edcda70)
* bpo-30871: pythoninfo: add expat and _decimal (#3121)
* bpo-30871: pythoninfo: add expat and _decimal
* Remove _decimal.__version__
The string is hardcoded, not really interesting.
(cherry picked from commit f6ebd838f00b4c211c72d85ee49749e910cd3afe)
* bpo-30871: Add "make pythoninfo" (#3120)
(cherry picked from commit a3a01a2fceab2188b282ab9911f79c99a4c32273)
* bpo-30871: pythoninfo: more sys, os, time data (#3130)
* bpo-30871: pythoninfo: more sys, os, time data
PythonInfo now converts types other than intger to string by default.
* fix typo
(cherry picked from commit ad7eaed54382b346784e51a6f0122ce81e8842b5)
* bpo-31231: Fix pythoninfo in Travis config (#3134)
bpo-31231, bpo-30871: Replace "./python -m test.pythoninfo" with
"make pythoninfo", since macOS uses ./python.exe.
(cherry picked from commit 92b1f90143286385c0ff5be98d3721b90580a912)
(cherry picked from commit 29d007bb670b486788f73c2d742b0ad0b679ff13)
|
|
|
| |
Check "tests" before its value is replaced.
|
|
|
| |
Add the CPU count in the header.
|
|
|
|
|
| |
Fix a warning about dangling processes in test_rapid_restart() of
_test_multiprocessing: join the process.
(cherry picked from commit 17657bb9458ff8f8804b7637d61686a68f4b9471)
|
|
|
|
|
|
|
|
|
|
|
| |
OpenSSL 1.1.0 to 1.1.0e aborted the handshake when server and client
could not agree on a protocol using ALPN. OpenSSL 1.1.0f changed that.
The most recent version now behaves like OpenSSL 1.0.2 again. The ALPN
callback can pretend to not been set.
See https://github.com/openssl/openssl/pull/3158 for more details
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit a5c1bab352671e043645163ca50c5211aa657acd)
|
|
|
|
|
| |
test_subprocess now also calls reap_children() in tearDown(), not
only on setUp().
(cherry picked from commit cc42c121eb5346f673247f95dac575aadb77d66c)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current test_child_terminated_in_stopped_state() function test
creates a child process which calls ptrace(PTRACE_TRACEME, 0, 0) and
then crash (SIGSEGV). The problem is that calling os.waitpid() in the
parent process is not enough to close the process: the child process
remains alive and so the unit test leaks a child process in a
strange state. Closing the child process requires non-trivial code,
maybe platform specific.
Remove the functional test and replaces it with an unit test which
mocks os.waitpid() using a new _testcapi.W_STOPCODE() function to
test the WIFSTOPPED() path.
(cherry picked from commit 7b7c6dcfff6a35333988a3c74c895ed19dff2e09)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-31160: regrtest now reaps child processes (#3044)
Add a post_test_cleanup() function which currently only calls
support.reap_children().
(cherry picked from commit e3510d74aacc477c30f42f2b941d69689bbc478e)
* bpo-31160: test_tempfile: Fix reap_children() warning (#3056)
TestRandomNameSequence.test_process_awareness() now calls
os.waitpid() to avoid leaking a zombie process.
(cherry picked from commit 6c8c2943d996b59a48d331f61f22cbe72933910e)
|
|
|
|
| |
reaped warnings (#3042)
|
|
|
|
|
|
|
|
| |
bpo-31135: Call the parent destroy() method even if the used
attribute doesn't exist.
The LabeledScale.destroy() method now also explicitly clears label
and scale attributes to help the garbage collector to destroy all
widgets.
|
|
|
| |
(cherry picked from commit c4c9866064f03646c686d7e08b00aeb203c35c19)
|
|
|
|
|
|
| |
some builtin and extension objects that don't support pickling
explicitly and are pickled incorrectly by default (like memoryview or
staticmethod).
|
|
|
| |
(cherry pick from 9cd7e17640a49635d1c1f8c2989578a8fc2c1de6)
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-31044: Skip test_posix.test_makedev() on FreeBSD (#2915)
There is a bug in FreeBSD CURRENT with 64-bit dev_t. Skip the test if
dev_t is larger than 32-bit, until the bug is fixed in FreeBSD
CURRENT.
(cherry picked from commit 12953ffe12ac781332b384c36b25d12216b1db62)
* Fix syntax for Python 2.7
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-31028: Fix test_pydoc when run directly
Fix get_pydoc_link() of test_pydoc to fix "./python
Lib/test/test_pydoc.py": get the absolute path to __file__ to prevent
relative directories.
* Use realpath() instead of abspath()
(cherry picked from commit fd46561167af6cd697191dd7ebb8c2fef5ad6493)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-30980: Fix close test to fail
test_close_twice was not considering the fact that file_wrapper is
duping the file descriptor. Closing the original descriptor left the
duped one open, hiding the fact that close protection is not effective.
* bpo-30980: Fix double close protection
Invalidated self.fd before closing, handling correctly the case when
os.close raises.
* bpo-30980: Fix fd leak introduced in the fixed test
|
|
|
|
|
|
| |
* bpo-30778: Skip test_bsddb3 on Windows XP
* Fix if, don't skip Windows Vista
|
|
|
|
|
|
|
| |
multiprocessing.Process.is_alive() now removes the process from the
_children set if the process completed.
The change prevents leaking "dangling" processes.
(cherry picked from commit 2db64823c20538a6cfc6033661fab5711d2d4585)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027)
multiprocessing.Queue.get() with a timeout now polls its reader in
non-blocking mode if it succeeded to aquire the lock but the acquire
took longer than the timeout.
Co-Authored-By: Grzegorz Grzywacz <grzgrzgrz3@gmail.com>
(cherry picked from commit 1b7863c3b6519c6e134c28cab8b8af0dea43e375)
* bpo-30595: Increase test_queue_feeder_donot_stop_onexc() timeout (#2148)
_test_multiprocessing.test_queue_feeder_donot_stop_onexc() now uses a
timeout of 1 second on Queue.get(), instead of 0.1 second, for slow
buildbots.
(cherry picked from commit 8f6eeaf21cdf4aea25fdefeec814a1ce07453fe9)
(cherry picked from commit e42339d3a08a8fde3349722def85d7a8e49899be)
|
|
|
|
| |
command (#1214) (#2894)
|
|
|
|
|
| |
bpo-30850: On Windows, test04_lock_timeout2() now tolerates 50 ms
whereas 100 ms is expected. The lock sometimes times out after only
58 ms. Windows clocks have a bad resolution and bad accuracy.
|
|
|
|
| |
Fix also regrtest command line parser to allow passing -u
extralargefile to run test_zipfile64.
|
|
|
|
| |
(GH-2755)
|
|
|
|
|
|
| |
(GH-2690) (#2694)
encoder and decoder..
(cherry picked from commit d3aaa2f1496aae0809c9ec9623fa528d3a2c16c2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-30855: Trying to fix test_use on Windows.
Avoid possible weird behavior of WideInt convertion.
"winfo id" always returns string hexadecimal representation.
(cherry picked from commit b9d672491d5082c541bf267eb7bb99fdc6529324)
* bpo-30855: Trying to fix test_use on Windows.
(cherry picked from commit 29a2f7c6b38e5a6ed891aa72af38974a1ff2d372)
(subTest() removed since it was introduced in Python 3)
|
|
|
| |
(cherry picked from commit 76c567ee27342d76f631a35c8291b715b2a61f3e)
|
|
|
| |
This provides more information on test failures.
|
|
|
|
|
|
|
| |
list_cases() now unload modules, as the test runner does, to prevent
a failure in test_xpickle about test.pickletester loaded after
loading test_cpickle:
./python -m test --list-cases test_cpickle test_xpickle
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Copy Lib/test/test_robotparser.py from master to 2.7 and adapt it for
Python 2.7:
* Replace urllib.robotparser with robotparser
* Adjust HTTPServer import
* Replace io.StringIO with StringIO.StringIO
* Remove tests on crawl_delay() and request_rate() since these
methods were added to Python 3
* Remove subTest()
* Add test_main() which explicitly lists all test cases
Patch based on the commit 4da0fd06ce49132d5c2e0525c4a31f807690a9ed
written by Berker Peksag.
Co-Authored-By: Berker Peksag <berker.peksag@gmail.com>
|
|
|
|
|
| |
* Rename again Lib/test/bisectcmd.py to Lib/test/bisect.py
* regrtest now removes '' and Lib/test/ from sys.path
* Use absolute import in test_bisect
|
|
|
|
| |
Revert test_bisect.py change:
remove "from __future__ import absolute_import".
|
|
|
|
|
|
|
| |
Sleep 1 ms instead of 0.1 ms to workaround a rounding issue on
Windows. On Windows, time.sleep(0.0001) sleeps 0 ms, so
collect_in_thread() calls gc.collect() in a loop and tests using this
thread takes too long. Sleep 1 ms so time.sleep() sleeps 15.6 ms on
Windows.
|