Fixes the misleading IsADirectoryError to be FileNotFoundError.
(cherry picked from commit 248173cc04)
Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
As of 088a15c49d, lineno is None instead
of -1 if there is no line number.
Signed-off-by: Filipe Laíns <lains@riseup.net>.
(cherry picked from commit 91a8f8c16c)
Co-authored-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Filipe Laíns <lains@riseup.net>
* Issue a deprecation warning on smtpd import
* Also issue DeprecationWarnings for asynchat and asyncore
* Fix some tests
* test___all__ requires the word 'module' or 'package' in the deprecation
warning text, so add those to smtpd, asynchat, and asyncore.
* In test_support, use pprint now instead of asyncore as the landmark.
* Add What's New
* Use ..deprecated::
* Use ..deprecated::
* Update Lib/smtpd.py
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* Update Doc/library/smtpd.rst
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* Import async{hat,ore} after the DeprecationWarning for this module
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
(cherry picked from commit 8488b85c63)
Co-authored-by: Barry Warsaw <barry@python.org>
Automerge-Triggered-By: GH:warsaw
Py_RunMain() now resets PyImport_Inittab to its initial value at
exit. It must be possible to call PyImport_AppendInittab() or
PyImport_ExtendInittab() at each Python initialization.
(cherry picked from commit 489699ca05)
No longer use len() to get the length of the input data. For some buffer protocol objects,
the length obtained by using len() is wrong.
(cherry picked from commit bc6c12c72a)
Co-authored-by: Ma Lin <animalize@users.noreply.github.com>
Fix asyncio test_popen() of test_windows_utils by using a longer
timeout. Use military grade battle-tested test.support.SHORT_TIMEOUT
timeout rather than a hardcoded timeout of 10 seconds: it's 30
seconds by default, but it is made longer on slow buildbots.
WaitForMultipleObjects() timeout argument is in milliseconds.
(cherry picked from commit be1cb3214d)
Co-authored-by: Victor Stinner <vstinner@python.org>
The faulthandler module now detects if a fatal error occurs during a
garbage collector collection (only if all_threads is true).
(cherry picked from commit d19163912b)
Test for execution of the body was null. It would pass
even if the code which should be skipped was executed.
(cherry picked from commit 5d2b3a0d68)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [Enum] reduce scope of new format behavior
Instead of treating all Enums the same for format(), only user mixed-in
enums will be affected. In other words, IntEnum and IntFlag will not be
changing the format() behavior, due to the requirement that they be
drop-in replacements of existing integer constants.
If a user creates their own integer-based enum, then the new behavior
will apply:
class Grades(int, Enum):
A = 5
B = 4
C = 3
D = 2
F = 0
Now: format(Grades.B) -> DeprecationWarning and '4'
3.12: -> no warning, and 'B'.
(cherry picked from commit f60b07ab6c)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
This avoids the following error if DeprecationWarnings are ignored.
======================================================================
ERROR: test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests)
Prior versions of Distribution.entry_points would return a
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/Python-3.10.0b3/Lib/test/test_importlib/test_metadata_api.py", line 145, in test_entry_points_by_index
expected = next(iter(caught))
StopIteration
----------------------------------------------------------------------
Ran 1402 tests in 2.125s
FAILED (errors=1, skipped=18, expected failures=1)
(cherry picked from commit df1502e47f)
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
In an inheritance chain of
int -> my_int -> final_int
the data type is now final_int (not my_int)
(cherry picked from commit 3a7cccfd6c)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit bf527277d4)
Co-authored-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: GH:tiran
by-value lookups could fail on complex enums, necessitating a check for
__reduce__ and possibly sabotaging the final enum;
by-name lookups should never fail, and sabotaging is no longer necessary
for class-based enum creation.
(cherry picked from commit 62f1d2b3d7)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>