summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Minor wording change in concurrent.futures. (GH-23194)Don Kirkby2020-11-081-3/+3
| | | Fixes a grammar problem by adding a missing "as", and clarifies the wording of the valid ranges for max_workers.
* bpo-40077: Convert _queuemodule to use heap types (GH-23136)Erlend Egeberg Aasland2020-11-073-105/+138
| | | @vstinner / @corona10, would you mind reviewing this?
* bpo-42282: Fold constants inside named expressions (GH-23190)Nick Coghlan2020-11-072-11/+46
| | | | | | | * The AST optimiser wasn't descending into named expressions, so any constant subexpressions weren't being folded at compile time * Remove "default:" clauses inside the AST optimiser code to reduce the risk of similar bugs passing unnoticed in future compiler changes
* bpo-41028: Doc: Move switchers to docsbuild-scripts. (GH-20969)Julien Palard2020-11-076-173/+16
|
* bpo-42133: update parts of the stdlib to fall back to `__spec__.loader` when ↵Brett Cannon2020-11-076-14/+59
| | | | `__loader__` is missing (#22929)
* Remove outdated reference to pywin32 from platform module (GH-22005)Andre Delfino2020-11-061-7/+0
|
* bpo-41832: PyType_FromModuleAndSpec() now accepts NULL tp_doc (GH-23123)Hai Shi2020-11-067-4/+44
|
* Minor grammar edits for the descriptor howto guide (GH-#23175)Raymond Hettinger2020-11-061-10/+10
|
* bpo-42179: Doc/tutorial: Remove mention of __cause__ (GH-23162)Inada Naoki2020-11-061-9/+10
|
* bpo-26389: Allow passing an exception object in the traceback module (GH-22610)Zackery Spytz2020-11-055-24/+97
| | | | | | The format_exception(), format_exception_only(), and print_exception() functions can now take an exception object as a positional-only argument. Co-Authored-By: Matthias Bussonnier <bussonniermatthias@gmail.com>
* bpo-42260: PyConfig_Read() only parses argv once (GH-23168)Victor Stinner2020-11-056-105/+134
| | | | | | | | | | | | The PyConfig_Read() function now only parses PyConfig.argv arguments once: PyConfig.parse_argv is set to 2 after arguments are parsed. Since Python arguments are strippped from PyConfig.argv, parsing arguments twice would parse the application options as Python options. * Rework the PyConfig documentation. * Fix _testinternalcapi.set_config() error handling. * SetConfigTests no longer needs parse_argv=0 when restoring the old configuration.
* bpo-42260: Add _PyConfig_FromDict() (GH-23167)Victor Stinner2020-11-056-60/+653
| | | | | | | * Rename config_as_dict() to _PyConfig_AsDict(). * Add 'module_search_paths_set' to _PyConfig_AsDict(). * Add _PyConfig_FromDict(). * Add get_config() and set_config() to _testinternalcapi. * Add config_check_consistency().
* bpo-41877 Check for asert, aseert, assrt in mocks (GH-23165)vabr-g2020-11-053-3/+14
| | | | | | | | | | | Currently, a Mock object which is not unsafe will raise an AttributeError if an attribute with the prefix assert or assret is accessed on it. This protects against misspellings of real assert method calls, which lead to tests passing silently even if the tested code does not satisfy the intended assertion. Recently a check was done in a large code base (Google) and three more frequent ways of misspelling assert were found causing harm: asert, aseert, assrt. These are now added to the existing check.
* [docs] fix wrongly named AsyncContextDecorator (GH-23164)kj2020-11-051-3/+5
| | | Also added versionchanged.
* bpo-42262: Add Py_NewRef() and Py_XNewRef() (GH-23152)Victor Stinner2020-11-057-6/+85
| | | | Added Py_NewRef() and Py_XNewRef() functions to increment the reference count of an object and return the object.
* bpo-42266: Handle monkey-patching descriptors in LOAD_ATTR cache (GH-23157)Pablo Galindo2020-11-054-7/+28
|
* bpo-40816 Add AsyncContextDecorator class (GH-20516)Kazantcev Andrey2020-11-054-1/+114
| | | | Co-authored-by: Yury Selivanov <yury@edgedb.com>
* bpo-42260: Add _PyInterpreterState_SetConfig() (GH-23158)Victor Stinner2020-11-049-16/+189
| | | | | | | | * Inline _PyInterpreterState_SetConfig(): replace it with _PyConfig_Copy(). * Add _PyErr_SetFromPyStatus() * Add _PyInterpreterState_GetConfigCopy() * Add a new _PyInterpreterState_SetConfig() function. * Add an unit which gets, modifies, and sets the config.
* Disable peg generator tests when building with PGO (GH-23141)serge-sans-paille2020-11-041-0/+6
| | | | | Otherwise, when running the testsuite, test_peg_generator tries to compile C code using the optimized flags and fails because it cannot find the profile data.
* bpo-1635741: _sqlite3 uses PyModule_AddObjectRef() (GH-23148)Erlend Egeberg Aasland2020-11-042-17/+16
|
* bpo-1635741: Fix PyInit_pyexpat() error handling (GH-22489)Mohamed Koubaa2020-11-041-189/+299
| | | | Split PyInit_pyexpat() into sub-functions and fix reference leaks on error paths.
* bpo-42260: Main init modify sys.flags in-place (GH-23150)Victor Stinner2020-11-044-74/+89
| | | | | | | | | | | When Py_Initialize() is called twice, the second call now updates more sys attributes for the configuration, rather than only sys.argv. * Rename _PySys_InitMain() to _PySys_UpdateConfig(). * _PySys_UpdateConfig() now modifies sys.flags in-place, instead of creating a new flags object. * Remove old commented sys.flags flags (unbuffered and skip_first). * Add private _PySys_GetObject() function. * When Py_Initialize(), Py_InitializeFromConfig() and
* bpo-1635741: Fix ref leak in _PyWarnings_Init() error path (GH-23151)Victor Stinner2020-11-042-11/+5
| | | | | | Replace PyModule_AddObject() with PyModule_AddObjectRef() in the _warnings module to fix a reference leak on error. Use also PyModule_AddObjectRef() in importdl.c.
* bpo-1635741: _ast uses PyModule_AddObjectRef() (GH-23146)Victor Stinner2020-11-042-220/+117
| | | | Replace PyModule_AddObject() with PyModule_AddObjectRef() in the _ast module (Python-ast.c).
* bpo-1635741: _contextvars uses PyModule_AddType() (GH-23147)Victor Stinner2020-11-042-21/+6
| | | | | | Replace PyModule_AddObject() with PyModule_AddType() in the _contextvars module (Python-ast.c). Add also the module name to _contextvars types name.
* bpo-42260: Reorganize PyConfig (GH-23149)Victor Stinner2020-11-041-5/+5
| | | | | | | | * Move orig_argv before argv * Move program_name and platlibdir with other path configuration inputs Give a name to the PyPreConfig and PyConfig structures and separate the type definitions.
* bpo-1635741: Add PyModule_AddObjectRef() function (GH-23122)Victor Stinner2020-11-045-46/+146
| | | | | Added PyModule_AddObjectRef() function: similar to PyModule_AddObjectRef() but don't steal a reference to the value on success.
* bpo-42236: os.device_encoding() respects UTF-8 Mode (GH-23119)Victor Stinner2020-11-045-17/+52
| | | | On Unix, the os.device_encoding() function now returns 'UTF-8' rather than the device encoding if the Python UTF-8 Mode is enabled.
* bpo-42251: Add gettrace and getprofile to threading (GH-23125)Mario Corchero2020-11-045-1/+61
| | | This allows to retrieve the functions that were set in these two, which might differ from sys.gettrace and sys.getprofile within a thread.
* Enable signing of nuget.org packages and update to supported timestamp ↵Steve Dower2020-11-035-8/+17
| | | | server (GH-23132)
* Fix incorrect links in ast docs (GH-23017)Matthew Suozzo2020-11-031-6/+7
|
* Add _PyType_GetModuleByDef (GH-22835)Petr Viktorin2020-11-034-3/+52
| | | | | See https://mail.python.org/archives/list/capi-sig@python.org/thread/T3P2QNLNLBRFHWSKYSTPMVEIL2EEKFJU/ for discussion. https://bugs.python.org/issue42100
* Post 3.10.0a2Pablo Galindo2020-11-031-1/+1
|
* Merge tag 'v3.10.0a2' into masterPablo Galindo2020-11-0393-255/+1047
|\ | | | | | | Python 3.10.0a2
| * Python 3.10.0a2v3.10.0a2Pablo Galindo2020-11-0393-255/+1047
| |
* | bpo-41796: Call _PyAST_Fini() earlier to fix a leak (GH-23131)Victor Stinner2020-11-035-44/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call _PyAST_Fini() on all interpreters, not only on the main interpreter. Also, call it ealier to fix a reference leak. Python types contain a reference to themselves in in their PyTypeObject.tp_mro member. _PyAST_Fini() must called before the last GC collection to destroy AST types. _PyInterpreterState_Clear() now calls _PyAST_Fini(). It now also calls _PyWarnings_Fini() on subinterpeters, not only on the main interpreter. Add an assertion in AST init_types() to ensure that the _ast module is no longer used after _PyAST_Fini() has been called.
* | bpo-42249: Fix writing binary Plist files larger than 4 GiB. (GH-23121)Serhiy Storchaka2020-11-032-1/+2
| |
* | bpo-40077: Convert mmap.mmap static type to a heap type (GH-23108)Erlend Egeberg Aasland2020-11-032-68/+91
|/
* bpo-35455: Fix thread_time for Solaris OS (GH-11118)Jakub Kulík2020-11-022-0/+20
|
* bpo-26789: Fix logging.FileHandler._open() at exit (GH-23053)Victor Stinner2020-11-024-8/+50
| | | | | | | | | | | | | | | | | | | The logging.FileHandler class now keeps a reference to the builtin open() function to be able to open or reopen the file during Python finalization. Fix errors like: Exception ignored in: (...) Traceback (most recent call last): (...) File ".../logging/__init__.py", line 1463, in error File ".../logging/__init__.py", line 1577, in _log File ".../logging/__init__.py", line 1587, in handle File ".../logging/__init__.py", line 1649, in callHandlers File ".../logging/__init__.py", line 948, in handle File ".../logging/__init__.py", line 1182, in emit File ".../logging/__init__.py", line 1171, in _open NameError: name 'open' is not defined
* bpo-41796: Make _ast module state per interpreter (GH-23024)Victor Stinner2020-11-028-202/+549
| | | | | | | | | | | The ast module internal state is now per interpreter. * Rename "astmodulestate" to "struct ast_state" * Add pycore_ast.h internal header: the ast_state structure is now declared in pycore_ast.h. * Add PyInterpreterState.ast (struct ast_state) * Remove get_ast_state() * Rename get_global_ast_state() to get_ast_state() * PyAST_obj2mod() now handles get_ast_state() failures
* bpo-42103: Improve validation of Plist files. (GH-22882)Serhiy Storchaka2020-11-024-57/+363
| | | | | | | | * Prevent some possible DoS attacks via providing invalid Plist files with extremely large number of objects or collection sizes. * Raise InvalidFileException for too large bytes and string size instead of returning garbage. * Raise InvalidFileException instead of ValueError for specific invalid datetime (NaN). * Raise InvalidFileException instead of TypeError for non-hashable dict keys. * Add more tests for invalid Plist files.
* bpo-41943: Fix bug where assertLogs doesn't correctly filter messages… ↵Irit Katriel2020-11-023-0/+14
| | | | | | | | | (GH-22565) … by level @vsajip , @pitrou Automerge-Triggered-By: GH:vsajip
* Revert "bpo-37193: remove thread objects which finished process its request ↵Jason R. Coombs2020-11-023-86/+13
| | | | | (GH-13893)" (GH-23107) This reverts commit c41559021213cfc9dc62a83fc63306b3bdc3e64b.
* bpo-42236: Enhance init and encoding documentation (GH-23109)Victor Stinner2020-11-0219-523/+738
| | | | | | | | | | | | | | | | | | | | | Enhance the documentation of the Python startup, filesystem encoding and error handling, locale encoding. Add a new "Python UTF-8 Mode" section. * Add "locale encoding" and "filesystem encoding and error handler" to the glossary * Remove documentation from Include/cpython/initconfig.h: move it to Doc/c-api/init_config.rst. * Doc/c-api/init_config.rst: * Document command line options and environment variables * Document default values. * Add a new "Python UTF-8 Mode" section in Doc/library/os.rst. * Add warnings to Py_DecodeLocale() and Py_EncodeLocale() docs. * Document how Python selects the filesystem encoding and error handler at a single place: PyConfig.filesystem_encoding and PyConfig.filesystem_errors. * PyConfig: move orig_argv member at the right place.
* bpo-42224: Fix test_format when locale does not expect number grouping ↵Lysandros Nikolaou2020-11-021-2/+5
| | | | (GH-23067)
* bpo-41435: Add sys._current_exceptions() function (GH-21689)Julien Danjou2020-11-027-1/+185
| | | | | | This adds a new function named sys._current_exceptions() which is equivalent ot sys._current_frames() except that it returns the exceptions currently handled by other threads. It is equivalent to calling sys.exc_info() for each running thread.
* bpo-42230: Improve asyncio documentation regarding accepting sets vs ↵Jakub Stasiak2020-11-022-6/+6
| | | | | | | | | | | | | | iterables (GH-23073) People call wait() and as_completed() with various non-set iterables, a list should be the most common but there are others as well[1]. Considering typeshed also documents wait()[2] and as_completed()[3] as accepting arbitrary iterables I think it's a good idea to document the status quo better. [1] https://github.com/aio-libs/aiokafka/pull/672 [2] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L161 [3] https://github.com/python/typeshed/blob/620989bac572f30349b95590ebe81a73ce0fe862/stdlib/3/asyncio/tasks.pyi#L40
* bpo-41229: Update docs for explicit aclose()-required cases and add ↵Joongi Kim2020-11-025-4/+133
| | | | | | | | | | | | | | | | | | | contextlib.aclosing() method (GH-21545) This is a PR to: * Add `contextlib.aclosing` which ia analogous to `contextlib.closing` but for async-generators with an explicit test case for [bpo-41229]() * Update the docs to describe when we need explicit `aclose()` invocation. which are motivated by the following issues, articles, and examples: * [bpo-41229]() * https://github.com/njsmith/async_generator * https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/#cleanup-in-generators-and-async-generators * https://www.python.org/dev/peps/pep-0533/ * https://github.com/achimnol/aiotools/blob/ef7bf0cea7af/src/aiotools/context.py#L152 Particuarly regarding [PEP-533](https://www.python.org/dev/peps/pep-0533/), its acceptance (`__aiterclose__()`) would make this little addition of `contextlib.aclosing()` unnecessary for most use cases, but until then this could serve as a good counterpart and analogy to `contextlib.closing()`. The same applies for `contextlib.closing` with `__iterclose__()`. Also, still there are other use cases, e.g., when working with non-generator objects with `aclose()` methods.
* Minor formatting edits to the descriptor howto guide (GH-23092)Raymond Hettinger2020-11-021-19/+20
|