Fix parsing of invalid email addresses with more than one @
(e.g.
a@[email protected].) to not return the part before 2nd @
as valid email address.
Patch by maxking & jpic.
Adjust correctly the recursion level in the symtable generation for named expressions. Patch by Pablo Galindo.
Fixed compilation of :keyword:`break` and :keyword:`continue` in the :keyword:`finally` block when the corresponding :keyword:`try` block contains :keyword:`return` with a non-constant value.
Reverted :issue:`32912`: emitting :exc:`SyntaxWarning` instead of :exc:`DeprecationWarning` for invalid escape sequences in string and bytes literals.
PEP 572: As described in the PEP, assignment expressions now raise :exc:`SyntaxError` when their interaction with comprehension scoping results in an ambiguous target scope.
The TargetScopeError
subclass originally proposed by the PEP has been
removed in favour of just raising regular syntax errors for the disallowed
cases.
Decoding bytes objects larger than 2GiB is faster and no longer fails when a multibyte characters spans a chunk boundary.
Fix SyntaxError
indicator printing too many spaces for multi-line
strings - by Anthony Sottile.
pdb.Pdb
supports ~/.pdbrc in Windows 7. Patch by Tim Hopper and Dan
Lidral-Porter.
Prevent shutil.rmtree exception when built on non-Windows system without fd system call support, like older versions of macOS.
Fix C compiler warning caused by distutils.ccompiler.CCompiler.has_function.
repr()
of buffered and text streams now silences only expected
exceptions when get the value of "name" and "mode" attributes.
Most features of the subprocess module now work again in subinterpreters. Only preexec_fn is restricted in subinterpreters.
Fix the rusage implementation of time.process_time() to correctly report the sum of the system and user CPU time.
Fix :func:`ast.dump` when call with incompletely initialized node.
Restores instantiation of Windows IOCP event loops from the non-main thread.
Add default implementation of the :meth:`ast.NodeVisitor.visit_Constant`
method which emits a deprecation warning and calls corresponding methody
visit_Num()
, visit_Str()
, etc.
Update test_statistics.py to verify that the statistics module works well for both C and Python implementations. Patch by Dong-hee Na
Added a new status code to the http module: 451 UNAVAILABLE_FOR_LEGAL_REASONS
Fix a segmentation fault that appeared when comparing instances of
datetime.timezone
and datetime.tzinfo
objects. Patch by Pablo
Galindo.
Fix dataclasses.is_dataclass when given an instance that never raises AttributeError in __getattr__. That is, an object that returns something for __dataclass_fields__ even if it's not a dataclass.
Fix socket
module's socket.connect(address)
function being unable to
establish connection in case of interrupted system call. The problem was
observed on all OSes which poll(2)
system call can take only
non-negative integers and -1 as a timeout value.
Fix faulthandler.register(chain=True)
stack. faulthandler now allocates
a dedicated stack of SIGSTKSZ*2
bytes, instead of just SIGSTKSZ
bytes. Calling the previous signal handler in faulthandler signal handler
uses more than SIGSTKSZ
bytes of stack memory on some platforms.
Add C fastpath for statistics.NormalDist.inv_cdf() Patch by Dong-hee Na
Add Fraction.as_integer_ratio() to match the corresponding methods in bool, int, float, and decimal.
Fix :mod:`difflib` ?
hint in diff output when dealing with tabs. Patch
by Anthony Sottile.
In zipfile.Path
, when adding implicit dirs, ensure that ancestral
directories are added and that duplicates are excluded.
Mark calendar.py helper functions as being private. The follows PEP 8 guidance to maintain the style conventions in the module and it addresses a known case of user confusion.
Add definition of THREAD_STACK_SIZE for AIX in Python/thread_pthread.h The default thread stacksize caused crashes with the default recursion limit Patch by M Felt
Fix the implementation of curses addch(str, color_pair)
: pass the color
pair to setcchar()
, instead of always passing 0 as the color pair.
Fix performance regression on regular expression parsing with huge character sets. Patch by Yann Vaginay.
Fix IndexError in :mod:`email` package when trying to parse invalid address
fields starting with :
.
Fixed comparisons of :class:`datetime.timedelta` and :class:`datetime.timezone`.
Correct :func:`curses.unget_wch` error message. Patch by Anthony Sottile.
Make Activate.ps1 Powershell script static to allow for signing it.
Update wheels bundled with ensurepip (pip 19.2.3 and setuptools 41.2.0)
Allowed the pure Python implementation of :class:`datetime.timezone` to represent sub-minute offsets close to minimum and maximum boundaries, specifically in the ranges (23:59, 24:00) and (-23:59, 24:00). Patch by Ngalim Siregar
Adding a value error when an invalid value in passed to nargs Patch by Robert Leenders
Make json.loads faster for long strings. (Patch by Marco Paolini)
Recognize "UTF-8" as a valid value for LC_CTYPE in locale._parse_localename.
"python3 -m test -jN --timeout=TIMEOUT" now kills a worker process if it runs longer than TIMEOUT seconds.
Fix serialization of display name in originator or destination address fields with both encoded words and special chars.
Fix error unpickling datetime.time objects from Python 2 with seconds>=24. Patch by Justin Blanchard.
Add the optional Linux SocketCAN Broadcast Manager constants, used as flags to configure the BCM behaviour, in the socket module. Patch by Karl Ding.
Ensure method signature is used instead of constructor signature of a class while asserting mock object against method calls. Patch by Karthikeyan Singaravelan.
Fix UserString.encode()
to correctly return bytes
rather than a
UserString
instance.
Division handling of PurePath now returns NotImplemented instead of raising a TypeError when passed something other than an instance of str or PurePath. Patch by Roger Aiudi.
Added a link to dateutil.parser.isoparse in the datetime.fromisoformat documentation. Patch by Paul Ganssle
Beginning edits to Whatsnew 3.8
Stop recommending getopt in the tutorial for command line argument parsing and promote argparse.
Fix wording of arguments for :class:`Request` in :mod:`urllib.request`
In the documentation for difflib, a note was added explicitly warning that the results of SequenceMatcher's ratio method may depend on the order of the input strings.
Make C-API docs clear about what the "main" interpreter is.
Add tests for json.dump(..., skipkeys=True). Patch by Dong-hee Na.
Mark some individual tests to skip when --pgo is used. The tests marked increase the PGO task time significantly and likely don't help improve optimization of the final executable.
:func:`os.dup` no longer fails for standard streams on Windows 7.
The nul
file on Windows now returns True from :func:`~os.path.exists`
and a valid result from :func:`os.stat` with S_IFCHR
set.
Enable support for following symlinks in :func:`os.realpath`.
Treat all name surrogate reparse points on Windows in :func:`os.lstat` and other reparse points as regular files in :func:`os.stat`.
Add the module name in the formatted error message when DLL load fail
happens during module import in _PyImport_FindSharedFuncptrWindows()
.
Patch by Srinivas Nyayapati.
Trying to import the :mod:`crypt` module on Windows will result in an
:exc:`ImportError` with a message explaining that the module isn't supported
on Windows. On other platforms, if the underlying _crypt
module is not
available, the ImportError will include a message explaining the problem.
Fixes the icons used for file associations to the Microsoft Store package.
Fix use of registry values to launch Python from Microsoft Store app.
Replace use of :c:func:`strcasecmp` for the system function :c:func:`_stricmp`. Patch by Minmin Gong.
Increase the default stack size of threads from 5MB to 16MB on macOS, to match the stack size of the main thread. This avoids crashes on deep recursion in threads.
Properly handle user input warnings in IDLE shell. Cease turning SyntaxWarnings into SyntaxErrors.
IDLE Settings dialog now closes properly when there is no shell window.
Fixed completions list appearing too high or low when shown above the current line.
Refactor IDLE autocomplete and improve testing.
Reorder the Run menu. Put the most common choice, Run Module, at the top.
Improve ArgumentClinic converter for floats.
Argument Clinic now uses the argument name on errors with keyword-only argument instead of their position. Patch contributed by Rémi Lapeyre.
Options added by PySys_AddXOption()
are now handled the same way than
PyConfig.xoptions
and command line -X
options.
Fix a crash in PySys_SetArgvEx(0, NULL, 0)
.