summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* bpo-41064: Improve syntax error for invalid usage of '**' in f-strings ↵Pablo Galindo2021-03-244-1/+47
| | | | (GH-25006)
* Only check evalbreaker after calls and on backwards egdes. Makes sure that ↵Mark Shannon2021-03-242-46/+40
| | | | __exit__ or __aexit__ is called in with statments in case of interrupt. (GH-18334)
* Fix typo in fuzzer.c (GH-25013)Ikko Ashimine2021-03-241-2/+2
|
* bpo-42137: have ModuleType.__repr__ prefer __spec__ over module_repr() ↵Brett Cannon2021-03-247-153/+147
| | | | | (GH-24953) This is to work towards the removal of the use of module_repr() in Python 3.12 (documented as deprecated since 3.4).
* bpo-42914: add a pprint underscore_numbers option (GH-24864)sblondon2021-03-244-12/+48
| | | | | pprint() gains a new boolean underscore_numbers kwarg to emit integers with thousands separated by an underscore character for improved readability (for example 1_000_000 instead of 1000000).
* bpo-31861: Fix reference leak in builtin_anext_impl() (GH-25008)Pablo Galindo2021-03-241-1/+4
|
* bpo-43244: Remove the pyarena.h header (GH-25007)Victor Stinner2021-03-2420-187/+215
| | | | | | | | | | | | | | | | | | Remove the pyarena.h header file with functions: * PyArena_New() * PyArena_Free() * PyArena_Malloc() * PyArena_AddPyObject() These functions were undocumented, excluded from the limited C API, and were only used internally by the compiler. Add pycore_pyarena.h header. Rename functions: * PyArena_New() => _PyArena_New() * PyArena_Free() => _PyArena_Free() * PyArena_Malloc() => _PyArena_Malloc() * PyArena_AddPyObject() => _PyArena_AddPyObject()
* bpo-31861: Fix possible crash in PyAnextAwaitable_New (GH-25005)Pablo Galindo2021-03-241-1/+5
|
* bpo-43244: Remove parser_interface.h header file (GH-25001)Victor Stinner2021-03-2412-130/+70
| | | | | | | | | | | | | | | | | | | | | | | | | Remove parser functions using the "struct _mod" type, because the AST C API was removed: * PyParser_ASTFromFile() * PyParser_ASTFromFileObject() * PyParser_ASTFromFilename() * PyParser_ASTFromString() * PyParser_ASTFromStringObject() These functions were undocumented and excluded from the limited C API. Add pycore_parser.h internal header file. Rename functions: * PyParser_ASTFromFileObject() => _PyParser_ASTFromFile() * PyParser_ASTFromStringObject() => _PyParser_ASTFromString() These functions are no longer exported (replace PyAPI_FUNC() with extern). Remove also _PyPegen_run_parser_from_file() function. Update test_peg_generator to use _PyPegen_run_parser_from_file_pointer() instead.
* bpo-43452: Document the PyType_Lookup optimizations in the What's New for ↵Pablo Galindo2021-03-241-1/+4
| | | | 3.10 (GH-24949)
* bpo-31861: Complete the C-API docs for PyObject_GetAiter and PyAiter_Check ↵Pablo Galindo2021-03-235-0/+27
| | | | (GH-25004)
* bpo-43244: Add pycore_compile.h header file (GH-25000)Victor Stinner2021-03-2315-84/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the compiler functions using "struct _mod" type, because the public AST C API was removed: * PyAST_Compile() * PyAST_CompileEx() * PyAST_CompileObject() * PyFuture_FromAST() * PyFuture_FromASTObject() These functions were undocumented and excluded from the limited C API. Rename functions: * PyAST_CompileObject() => _PyAST_Compile() * PyFuture_FromASTObject() => _PyFuture_FromAST() Moreover, _PyFuture_FromAST() is no longer exported (replace PyAPI_FUNC() with extern). _PyAST_Compile() remains exported for test_peg_generator. Remove also compatibility functions: * PyAST_Compile() * PyAST_CompileEx() * PyFuture_FromAST()
* bpo-31861: Add aiter and anext to builtins (#23847)Joshua Bronson2021-03-2310-28/+373
| | | | | | Co-authored-by: jab <jab@users.noreply.github.com> Co-authored-by: Daniel Pope <mauve@mauveweb.co.uk> Co-authored-by: Justin Wang <justin39@gmail.com>
* bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers (GH-24933)Victor Stinner2021-03-2329-933/+931
| | | | | | | | | | | | | | | | These functions were undocumented and excluded from the limited C API. Most names defined by these header files were not prefixed by "Py" and so could create names conflicts. For example, Python-ast.h defined a "Yield" macro which was conflict with the "Yield" name used by the Windows <winbase.h> header. Use the Python ast module instead. * Move Include/asdl.h to Include/internal/pycore_asdl.h. * Move Include/Python-ast.h to Include/internal/pycore_ast.h. * Remove ast.h header file. * pycore_symtable.h no longer includes Python-ast.h.
* bpo-41718: Update runpy startup time What's New (GH-24998)Victor Stinner2021-03-231-3/+4
|
* bpo-41718: runpy now imports pkgutil in functions (GH-24996)Victor Stinner2021-03-231-1/+2
| | | | | | Reduce the number of modules imported by "python3 -m module". The runpy module no longer imports at startup (in the module body), but only in functions using it: _get_code_from_file() and run_path().
* bpo-41718: subprocess imports grp and pwd on demand (GH-24987)Victor Stinner2021-03-232-24/+23
| | | | | The shutil and subprocess modules now only import the grp and pwd modules when they are needed, which is not the case by default in subprocess.
* Clarify attribute docs on types.ModuleType (GH-24974)Brett Cannon2021-03-231-2/+30
|
* bpo-41718: libregrtest avoids importing datetime (GH-24985)Victor Stinner2021-03-232-5/+6
| | | | * libregrtest reimplements datetime.timedelta.__str__() * support.testresult only imports datetime if USE_XML is true.
* bpo-41718: Disable support.testresult XML output by default (GH-24982)Victor Stinner2021-03-232-7/+22
| | | | | | | RegressionTestResult.USE_XML must now be set to True to get the JUnit XML output. Reduce the number of imports when --junit-xml=FILE option is not used: 153 => 144 (-9).
* bpo-41718: libregrtest runtest avoids import_helper (GH-24983)Victor Stinner2021-03-231-2/+4
| | | | Inline import_helper.unload() in libregrtest.runtest to avoid one import.
* bpo-41718: Reduce libregrtest runtest imports (GH-24980)Victor Stinner2021-03-223-97/+107
| | | | | | Move clear_caches() from libregrtest.refleak to libregrtest.utils to avoid importing libregrtest.refleak when it's not needed. clear_caches() now only calls re.purge() if 're' is in sys.modules.
* bpo-41718: regrtest saved_test_environment avoids imports (GH-24934)Victor Stinner2021-03-222-42/+69
| | | | | | | | | | | | | | | | | | | | | | | | | Reduce the number of modules imported by libregrtest. saved_test_environment no longer imports modules at startup, but try to get them from sys.modules. If an module is missing, skip the test. It also sets directly support.environment_altered. runtest() now now two saved_test_environment instances: one before importing the test module, one after importing it. Remove imports from test.libregrtest.save_env: * asyncio * logging * multiprocessing * shutil * sysconfig * urllib.request * warnings When a test method imports a module (ex: warnings) and the test has a side effect (ex: add a warnings filter), the side effect is not detected, because the module was not imported when Python enters the saved_test_environment context manager.
* bpo-43555: Report the column offset for invalid line continuation character ↵Pablo Galindo2021-03-224-6/+13
| | | | (GH-24939)
* bpo-43591: Fix error location in interactive mode for errors at the end of ↵Pablo Galindo2021-03-222-7/+17
| | | | | the line (GH-24973) Co-authored-by: Erlend Egeberg Aasland
* Revert "bpo-40521: Make dtoa bigint free list per-interpreter (GH-24821)" ↵Victor Stinner2021-03-223-39/+17
| | | | | (GH-24964) This reverts commit 5bd1059184b154d339f1bd53d23c98b5bcf14c8c.
* bpo-43575: Use PEP 590 vectorcall to speed up map() (GH-24955)Dong-hee Na2021-03-222-2/+45
|
* bpo-43551: Fix PyImport_Import() for subinterpreters (GH-24929)junyixie2021-03-221-16/+21
| | | Avoid static variables.
* bpo-35134: Add include/cpython/compile.h (GH-24922)Hai Shi2021-03-226-94/+100
| | | | Move C API excluded from the limited C API from Include/compile.h to a new Include/cpython/compile.h header file.
* bpo-43420: Simple optimizations for Fraction's arithmetics (GH-24779)Sergey B Kirpichev2021-03-224-9/+121
| | | | | | | bpo-43420: Implement standard transformations in + - * / that can often reduce the size of intermediate integers needed. For rationals with large components, this can yield dramatic speed improvements, but for small rationals can run 10-20% slower, due to increased fixed overheads in the longer-winded code. If those slowdowns turn out to be a problem, see the PR discussion for low-level implementation tricks that could cut other fixed overheads. Co-authored-by: Tim Peters <tim.peters@gmail.com> Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-43569: Add test/test_importlib/namespacedata01 to TESTSUBDIRS (GH-24952)Jason R. Coombs2021-03-211-0/+1
|
* bpo-43422: Revert _decimal C API addition (GH-24960)Antoine Pitrou2021-03-2110-1119/+20
| | | | | | | | | Stefan Krah requested the reversal of these (unreleased) changes, quoting him: > The capsule API does not meet my testing standards, since I've focused on the upstream mpdecimal in the last couple of months. > Additionally, I'd like to refine the API, perhaps together with the Arrow community. Automerge-Triggered-By: GH:pitrou
* bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback ↵Christian Heimes2021-03-214-0/+29
| | | | | | | | | | | | (GH-24957) OpenSSL copies the internal message callback from SSL_CTX->msg_callback to SSL->msg_callback. SSL_set_SSL_CTX() does not update SSL->msg_callback to use the callback value of the new context. PySSL_set_context() now resets the callback and _PySSL_msg_callback() resets thread state in error path. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43542: Add heif/heic formats in mimetypes (GH-24917)Ilya Stepin2021-03-202-0/+3
| | | | | | | | | | * bpo-43542: Add heif/heic formats in mimetypes Add HEIF and HEIC format to list of media types. It has IANA registration. IANA: https://www.iana.org/assignments/media-types/image/heic HEIF Github: https://github.com/nokiatech/heif Co-authored-by: Gregory P. Smith <greg@krypto.org>
* bpo-43571: Add IPPROTO_MPTCP macro (GH-24946)Rui Cunha2021-03-204-0/+10
| | | Add IPPROTO_MPTCP constant when defined in the system headers.
* bpo-43517 (followup): Install additional test directory (GH-24950)Antoine Pitrou2021-03-201-0/+1
| | | | | Should fix some CI failures on buildbots that test an installed version of Python. Automerge-Triggered-By: GH:pitrou
* bpo-43452: Micro-optimizations to PyType_Lookup (GH-24804)Dino Viehland2021-03-202-28/+24
| | | | | | | | | The common case going through _PyType_Lookup is to have a cache hit. There are some small tweaks that can make this a little cheaper: * The name field identity is used for a cache hit and is kept alive by the cache. So there's no need to read the hash code o the name - instead, the address can be used as the hash. * There's no need to check if the name is cachable on the lookup either, it probably is, and if it is, it'll be in the cache. * If we clear the version tag when invalidating a type then we don't actually need to check for a valid version tag bit.
* bpo-43517: Fix false positive in detection of circular imports (#24895)Antoine Pitrou2021-03-205-2/+81
|
* bpo-43494: Make some minor changes to lnotab notes (GH-24861)Skip Montanaro2021-03-191-6/+6
| | | | This cleanup makes no substantive changes.
* Mention that code.co_lnotab is deprecated in what's new for 3.10. (#24902)Mark Shannon2021-03-191-0/+2
|
* bpo-43244: Remove symtable.h header file (GH-24910)Victor Stinner2021-03-1915-115/+100
| | | | | | | | | | | | | | | | | | Rename Include/symtable.h to to Include/internal/pycore_symtable.h, don't export symbols anymore (replace PyAPI_FUNC and PyAPI_DATA with extern) and rename functions: * PyST_GetScope() to _PyST_GetScope() * PySymtable_BuildObject() to _PySymtable_Build() * PySymtable_Free() to _PySymtable_Free() Remove PySymtable_Build(), Py_SymtableString() and Py_SymtableStringObject() functions. The Py_SymtableString() function was part the stable ABI by mistake but it could not be used, since the symtable.h header file was excluded from the limited C API. The Python symtable module remains available and is unchanged.
* bpo-43466: Add --with-openssl-rpath configure option (GH-24820)Christian Heimes2021-03-199-7304/+5214
|
* Fix a typo in c-analyzer (GH-24468)Ikko Ashimine2021-03-191-1/+1
|
* bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915)Christian Heimes2021-03-183-1/+31
| | | | | | | | | | Ubuntu 20.04 comes with a patched OpenSSL 1.1.1. Default security level 2 blocks TLS 1.0 and 1.1 connections. Regular OpenSSL 1.1.1 builds allow TLS 1.0 and 1.1 on security level 2. See: See: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1899878 See: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1917625 Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897)Kodi Arfer2021-03-183-9/+27
| | | Automerge-Triggered-By: GH:pablogsal
* bpo-43244: Remove the PyAST_Validate() function (GH-24911)Victor Stinner2021-03-187-5/+15
| | | | | | | | | | | | Remove the PyAST_Validate() function. It is no longer possible to build a AST object (mod_ty type) with the public C API. The function was already excluded from the limited C API (PEP 384). Rename PyAST_Validate() function to _PyAST_Validate(), move it to the internal C API, and don't export it anymore (replace PyAPI_FUNC with extern). The function was added in bpo-12575 by the commit 832bfe2ebd5ecfa92031cd40c8b41835ba90487f.
* bpo-43541: Fix PyEval_EvalCodeEx() regression (GH-24918)Victor Stinner2021-03-184-6/+6
| | | | | | | | | | | * Remove an assertion which required CO_NEWLOCALS and CO_OPTIMIZED code flags. It is ok to call this function on a code with these flags set. * Fix reference counting on builtins: remove Py_DECREF(). Fix regression introduced in the commit 46496f9d12582bf11f4911ad0f23315d6f277907. Add also a comment to document that _PyEval_BuiltinsFromGlobals() returns a borrowed reference.
* bpo-43244: Fix test_peg_generators on Windows (GH-24913)Victor Stinner2021-03-182-6/+4
| | | | Don't redefine Py_DebugFlag, it's already defined in pydebug.h which is included by Python.h
* bpo-39342: Expose X509_V_FLAG_ALLOW_PROXY_CERTS in ssl module (GH-18011)Chris Burr2021-03-184-0/+15
| | | Exposes the `X509_V_FLAG_ALLOW_PROXY_CERTS` constant as `ssl.VERIFY_ALLOW_PROXY_CERTS` to allow for proxy certificate validation as described in: https://www.openssl.org/docs/man1.1.1/man7/proxy-certificates.html
* bpo-43244: Fix test_peg_generator for PyAST_Validate() (GH-24912)Victor Stinner2021-03-184-282/+14
| | | | | | | | | test_peg_generator now defines _Py_TEST_PEGEN macro when building C code to not call PyAST_Validate() in Parser/pegen.c. Moreover, it defines Py_BUILD_CORE_MODULE macro to get access to the internal C API. Remove "global_ast_state" from Python-ast.c when it's built by test_peg_generator: always get the AST state from the current interpreter.