A remarkably powerful dynamic programming language

Python for Mac

Join our mailing list

Stay up to date with latest software releases, news, software discounts, deals and more.

Subscribe
Download Python 3.10.3

  -  38.5 MB  -  Open Source

What's new in this version:

Core and Builtins:
- Avoid overriding AttributeError metadata information for nested attribute access calls
- Rename the private undocumented float.__set_format__() method to float.__setformat__() to fix a typo introduced in Python 3.7. The method is only used by test_float
- Bump up the libexpat version into 2.4.6
- Fix parsing a numeric literal immediately (without spaces) followed by “not in” keywords, like in 1not in x. Now the parser only emits a warning, not a syntax error.
- Fix an assert failure in debug builds when a ‘<’, ‘>’, or ‘=’ is the last character in an f-string that’s missing a closing right brace.
- Make sure that all backwards jumps use the JUMP_ABSOLUTE instruction, rather than JUMP_FORWARD with an argument of (2**32)+offset.
- Correct the docstring for the __bool__() method. Patch by Jelle Zijlstra.
- Avoid potential exponential backtracking when producing some syntax errors involving lots of brackets
- Add a missing call to va_end() in Modules/_hashopenssl.c.
- When iterating over sets internally in setobject.c, acquire strong references to the resulting items from the set. This prevents crashes in corner-cases of various set operations where the set gets mutated.
- Remove two invalid “peephole” optimizations from the bytecode compiler.
- Fix docstrings of getter, setter, and deleter to clarify that they create a new copy of the property.
- Fix an assert when parsing some invalid N escape sequences in f-strings.
- Fix a race condition on setting a type __bases__ attribute: the internal function add_subclass() now gets the PyTypeObject.tp_subclasses member after calling PyWeakref_NewRef() which can trigger a garbage collection which can indirectly modify PyTypeObject.tp_subclasses
- Fix invalid signature of _zoneinfo’s module_free function to resolve a crash on wasm32-emscripten platform.
- Py_EndInterpreter() now explicitly untracks all objects currently tracked by the GC. Previously, if an object was used later by another interpreter, calling PyObject_GC_UnTrack() on the object crashed if the previous or the next object of the PyGC_Head structure became a dangling pointer
- Fix a crash in the parser when retrieving the error text for multi-line f-strings expressions that do not start in the first line of the string
- Correct the error message for unclosed parentheses when the tokenizer doesn’t reach the end of the source when the error is reported
- Correctly calculate indentation levels for lines with whitespace character that are ended by line continuation characters

Library:
- Fix a crash when closing transports where the underlying socket handle is already invalid on the Proactor event loop.
- Apply bugfixes from importlib_metadata 4.11.3, including bugfix for EntryPoint.extras, which was returning match objects and not the extras strings.
- Upgrade pip wheel bundled with ensurepip (pip 22.0.4)
- faulthandler: On Linux 5.14 and newer, dynamically determine size of signal handler stack size CPython allocates using getauxval(AT_MINSIGSTKSZ). This changes allows for Python extension’s request to Linux kernel to use AMX_TILE instruction set on Sapphire Rapids Xeon processor to succeed, unblocking use of the ISA in frameworks.
- Expose asyncio.base_events.Server as asyncio.Server.
- The signal module no longer assumes that SIG_IGN and SIG_DFL are small int singletons.
- Update bundled libexpat to 2.4.7
- Fixed a file leak in xml.etree.ElementTree.iterparse() when the iterator is not exhausted
- Inherit asyncio proactor datagram transport from asyncio.DatagramTransport.
- Support UDP sockets in asyncio.loop.sock_connect() for selector-based event loops
- Make test suite support Expat >=2.4.5
- Raise TypeError if ssl.SSLSocket is passed to transport-based APIs.
- Fix libexpat symbols collisions with user dynamically loaded or statically linked libexpat in embedded Python.
- shutil.rmtree() can now work with VirtualBox shared folders when running from the guest operating-system
- Fix a bug in urllib.request.HTTPPasswordMgr.find_user_password() and urllib.request.HTTPPasswordMgrWithPriorAuth.is_authenticated() which allowed to bypass authorization. For example, access to URI example.org/foobar was allowed if the user was authorized for URI example.org/foo.
- In typing.get_type_hints(), support evaluating stringified ParamSpecArgs and ParamSpecKwargs annotations
- When the tarfile module creates a pax format archive, it will put an integer representation of timestamps in the ustar header (if possible) for the benefit of older unarchivers, in addition to the existing full-precision timestamps in the pax extended header.
- Make typing.ParamSpec args and kwargs equal to themselves
- Fix NameError in asyncio.gather() when initial type check fails.
- In typing.get_type_hints(), support evaluating bare stringified TypeAlias annotations
- Fixed a discrepancy in the C implementation of the xml.etree.ElementTree module. Now, instantiating an xml.etree.ElementTree.XMLParser with a target=None keyword provides a default xml.etree.ElementTree.TreeBuilder target as the Python implementation does.
- Fix a bug in the codeop module that was incorrectly identifying invalid code involving string quotes as valid code.
- Brings ParamSpec propagation for GenericAlias in line with Concatenate (and others).
- Make the IDLE doc URL on the About IDLE dialog clickable.
- expat: Update libexpat from 2.4.1 to 2.4.4
- Add the get_write_buffer_limits method to asyncio.transports.WriteTransport and to the SSL transport.
- Note the configparser deprecations will be removed in Python 3.12.
- In typing.get_type_hints(), support evaluating stringified ClassVar and Final annotations inside Annotated
- Allow typing.Annotated to wrap typing.Final and typing.ClassVar
- Fix command-line option -d/--directory in module http.server which is ignored when combined with command-line option --cgi. Patch by Géry Ogam.
- Make mock.patch() raise a TypeError with a relevant error message on invalid arg. Previously it allowed a cryptic AttributeError to escape.
- In importlib.metadata.EntryPoint.pattern, avoid potential REDoS by limiting ambiguity in consecutive whitespace
- asyncio generic classes now return types.GenericAlias in __class_getitem__ instead of the same class
- pdb now gracefully handles help when __doc__ is missing, for example when run with pregenerated optimized .pyc files
- The __eq__() and __hash__() methods of typing.ForwardRef now honor the module parameter of typing.ForwardRef. Forward references from different modules are now differentiated.
- Add missing __slots__ to importlib.metadata.DeprecatedList
- Improve day constants in calendar
- Now all constants (MONDAY … SUNDAY) are documented, tested, and added to __all__
- The ssl module now handles certificates with bit strings in DN correctly
- Fix a bug in inspect.signature() that was causing it to fail on some subclasses of classes with a __text_signature__ referencing module globals
- Fixed case where failing asyncio.ensure_future() did not close the coroutine
- Fix an issue with tarfile.TarFile.getmember() getting a directory name with a trailing slash
- Fix inconsistency with uppercase file extensions in MimeTypes.guess_type()
- Fix exception in argparse help text generation if a argparse.BooleanOptionalAction argument’s default is argparse.SUPPRESS and it has help specified
- Fix .write() method of a member file in ZipFile, when the input data is an object that supports the buffer protocol, the file length may be wrong
- When a namespace package is imported before another module from the same namespace is created/installed in a different sys.path location while the program is running, calling the importlib.invalidate_caches() function will now also guarantee the new module is noticed.
- Fix bug where unittest sometimes drops frames from tracebacks of exceptions raised in tests
- Fix substitution of ParamSpec in Concatenate with different parameter expressions. Substitution with a list of types returns now a tuple of types. Substitution with Concatenate returns now a Concatenate with concatenated lists of arguments.
- argparse.FileType now supports an argument of ‘-’ in binary mode, returning the .buffer attribute of sys.stdin/sys.stdout as appropriate. Modes including ‘x’ and ‘a’ are treated equivalently to ‘w’ when argument is ‘-’.

Join our mailing list

Stay up to date with latest software releases, news, software discounts, deals and more.

Subscribe