| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
The __exit__() method of test.support.catch_unraisable_exception
context manager now ignores unraisable exception raised when clearing
self.unraisable attribute.
|
|
|
|
|
|
|
| |
Allow pure Python implementation of pickle to work
even when the C _pickle module is unavailable.
Fix test_pickle when _pickle is missing: declare PyPicklerHookTests
outside "if has_c_implementation:" block.
|
|
|
| |
Remove the _tstate_lock from _shutdown_locks, don't remove None.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a race condition at Python shutdown when waiting for threads.
Wait until the Python thread state of all non-daemon threads get
deleted (join all non-daemon threads), rather than just wait until
Python threads complete.
* Add threading._shutdown_locks: set of Thread._tstate_lock locks
of non-daemon threads used by _shutdown() to wait until all Python
thread states get deleted. See Thread._set_tstate_lock().
* Add also threading._shutdown_locks_lock to protect access to
threading._shutdown_locks.
* Add test_finalization_shutdown() test.
|
|
|
|
|
|
|
|
| |
regrtest now uses sys.unraisablehook() to mark a test as "environment
altered" (ENV_CHANGED) if it emits an "unraisable exception".
Moreover, regrtest logs a warning in this case.
Use "python3 -m test --fail-env-changed" to catch unraisable
exceptions in tests.
|
|
|
|
|
|
| |
Use catch_unraisable_exception() to ignore 'Exception ignored in:'
error when the internal BufferedWriter of the BufferedRWPair is
destroyed. The C implementation doesn't give access to the
internal BufferedWriter, so just ignore the warning instead.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-14011)
because "getaddrinfo()" behaves different on AIX
https://bugs.python.org/issue35545
|
|
|
|
| |
Mock the HTTPConnection.close() method in a few unit tests to avoid
logging "Exception ignored in: ..." messages.
|
|
|
|
|
|
| |
Rename compile() feature_version parameter to _feature_version and
convert it to a keyword-only parameter.
Update also test_type_comments to pass feature_version as a tuple.
|
|
|
| |
If preadv2 is not available, preadv will raise NotImplementedError.
|
|
|
| |
This test "works" if things are run in the right order, so it's better to use @skip than @expectedFailure here.
|
|
|
|
|
|
| |
(GH-13965)
|
|
|
| |
Implement also MockNonBlockWriterIO.seek() method.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, inspect.getfile(str) will report nonsense:
```pytb
>>> inspect.getfile(str)
TypeError: <module 'builtins' (built-in)> is a built-in class
```
This fixes that
https://bugs.python.org/issue37173
|
|
|
| |
https://gitlab.com/python-devs/importlib_metadata/merge_requests/76
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
add_argument (GH-13805)
There is a possibility that someone (like me) accidentally will omit parentheses with `FileType` arguments after `FileType`, and parser will contain wrong file until someone will try to use it.
Example:
```python
parser = argparse.ArgumentParser()
parser.add_argument('-x', type=argparse.FileType)
```
https://bugs.python.org/issue37150
|
| |
|
| |
|
|
|
|
|
| |
Replace two Python function calls with a single one to ensure that no
memory allocation is done between the invalid object is created and
when _PyObject_IsFreed() is called.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-36520: reset the encoded word offset when starting a new
line during an email header folding operation
* 📜🤖 Added by blurb_it.
* bpo-36520: add an additional test case, and provide descriptive
comments for the test_folding_with_utf8_encoding_* tests
* bpo-36520: fix whitespace issue
* bpo-36520: changes per reviewer request -- remove extraneous
backslashes; add whitespace between terminating quotes and
line-continuation backslashes; use "bpo-" instead of
"issue #" in comments
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-11157)
In test_fromkeys() the derived test class now supports all arguments in its
constructor so that the class to be tested can use its own constructor in its
fromkeys() implementation.
In test_mutatingiteration() the test fails as soon as iterating over a
dictionary with one entry and adding new entries in the loop iterates more
than once (to avoid endless loops in faulty implementations).
https://bugs.python.org/issue2661
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-21315: Fix parsing of encoded words with missing leading ws.
Because of missing leading whitespace, encoded word would get parsed as
unstructured token. This patch fixes that by looking for encoded words when
splitting tokens with whitespace.
Missing trailing whitespace around encoded word now register a defect
instead.
Original patch suggestion by David R. Murray on bpo-21315.
|
|
|
| |
Turn deprecation warnings added in 3.8 into TypeError.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-30835: email: Fix AttributeError when parsing invalid Content-Transfer-Encoding
Parsing an email containing a multipart Content-Type, along with a
Content-Transfer-Encoding containing an invalid (non-ASCII-decodable) byte
will fail. email.feedparser.FeedParser._parsegen() gets the header and
attempts to convert it to lowercase before comparing it with the accepted
encodings, but as the header contains an invalid byte, it's returned as a
Header object rather than a str.
Cast the Content-Transfer-Encoding header to a str to avoid this.
Found using the AFL fuzzer.
Reported-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Andrew Donnellan <andrew@donnellan.id.au>
* Add email and NEWS entry for the bugfix.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-35805: Add parser for Message-ID header.
This parser is based on the definition of Identification Fields from RFC 5322
Sec 3.6.4.
This should also prevent folding of Message-ID header using RFC 2047 encoded
words and hence fix bpo-35805.
* Prevent folding of non-ascii message-id headers.
* Add fold method to MsgID token to prevent folding.
|
|
|
|
| |
test_venv.test_mutiprocessing() now explicitly calls pool.terminate()
to wait until the pool completes.
|
| |
|
|
|
| |
CP65001Test has been removed.
|
|
|
|
| |
Make test_stream_server_close() implementation following test_stream_server_abort().
Add explicit timeout for tests that can hang.
|
| |
|
|
|
|
| |
suite with huntleaks (GH-13800)
|
| |
|
|
|
|
|
| |
executed in non-main thread (#13630)" (GH-13793)
https://bugs.python.org/issue35621
|
|
|
| |
Signed-off-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
| |
Fix various compatibility issues with LibreSSL and OpenSSL 1.0.2
introduced by bpo-34271.
Signed-off-by: Christian Heimes <christian@python.org>
|
|
|
|
|
| |
_Py_AddPendingCall(). (gh-13714)" (GH-13780)
This reverts commit 6a150bcaeb190d1731b38ab9c7a5d1a352847ddc.
|
|
|
|
|
|
|
|
|
| |
Replace asyncio.set_event_loop() with TestCase.set_event_loop() of
test_asyncio.utils: this method calls TestCase.close_loop() which
waits until the executor completes, to avoid leaking dangling
threads.
Inherit from test_asyncio.utils.TestCase rather than
unittest.TestCase.
|
|
|
|
|
|
| |
This patch implements per opcode cache mechanism, and use it in
only LOAD_GLOBAL opcode.
Based on Yury's opcache3.patch in bpo-26219.
|
|
|
|
| |
(GH-13760)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modify test_coroutines, test_cprofile, test_generators, test_raise,
test_ssl and test_yield_from to use
support.catch_unraisable_exception() rather than
support.captured_stderr().
test_thread: remove test_save_exception_state_on_error() which is now
updated. test_unraisable_exception() checks that sys.unraisablehook()
is called to handle _thread.start_new_thread() exception.
test_cprofile now rely on unittest for test discovery: replace
support.run_unittest() with unittest.main().
|
|
|
|
| |
test_coroutines: test_unawaited_warning_when_module_broken() now uses
support.check_warnings() to catch expected RuntimeWarning.
|
|
|
|
|
| |
ThreadedChildWatcher (GH-13754)
https://bugs.python.org/issue35621
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When inheriting a heap subclass from a vectorcall class that sets
`.tp_call=PyVectorcall_Call` (as recommended in PEP 590), the subclass does
not inherit `_Py_TPFLAGS_HAVE_VECTORCALL`, and thus `PyVectorcall_Call` does
not work for it.
This attempts to solve the issue by:
* always inheriting `tp_vectorcall_offset` unless `tp_call` is overridden
in the subclass
* inheriting _Py_TPFLAGS_HAVE_VECTORCALL for static types, unless `tp_call`
is overridden
* making `PyVectorcall_Call` ignore `_Py_TPFLAGS_HAVE_VECTORCALL`
This means it'll be ever more important to only call `PyVectorcall_Call`
on classes that support vectorcall. In `PyVectorcall_Call`'s intended role
as `tp_call` filler, that's not a problem.
|
|
|
|
|
| |
As the code paths for various METH_* conventions are diverging due
to optimizations, we should check they continue to be covered by
GDB integration.
|
| |
|
| |
|