summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* [3.8] bpo-36974: separate vectorcall functions for each calling convention ↵Jeroen Demeyer2019-07-231-8/+8
| | | | (GH-13781) (#14782)
* [3.8] Fix typos in docs, comments and test assert messages (GH-14872). (#14900)Kyle Stanley2019-07-221-1/+1
| | | | | (cherry picked from commit 96e12d5f4f3c5a20986566038ee763dff3c228a1) Co-authored-by: Min ho Kim <minho42@gmail.com>
* Adjust builtins.zip() docstring to better communicate its signature (GH-14833)Miss Islington (bot)2019-07-191-1/+1
| | | | | (cherry picked from commit af2f5b1723b95e45e1f15b5bd52102b7de560f7c) Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
* bpo-37593: Swap the positions of posonlyargs and args in the constructor of ↵Miss Islington (bot)2019-07-143-145/+145
| | | | | | | | ast.parameters nodes (GH-14778) https://bugs.python.org/issue37593 (cherry picked from commit cd6e83b4810549c308ab2d7315dbab526e35ccf6) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-18374: fix wrong col_offset of some ast.BinOp instances (GH-14607)Miss Islington (bot)2019-07-081-1/+1
| | | | | | | | Nested BinOp instances (e.g. a+b+c) had a wrong col_offset for the second BinOp (e.g. 2 instead of 0 in the example). Fix it by using the correct st node to copy the line and col_offset from in ast.c. (cherry picked from commit 110a47c4f42cf4db88edc1876899fff8f05190fb) Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
* bpo-36763: Add PyConfig_SetWideStringList() (GH-14444)Miss Islington (bot)2019-07-011-1/+18
| | | | | (cherry picked from commit 36242fd871d0f0977e720d4fae5700774bd8c09a) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37467: Fix PyErr_Display() for bytes filename (GH-14504)Miss Islington (bot)2019-07-011-1/+1
| | | | | | | | | | | | | | | | | Fix sys.excepthook() and PyErr_Display() if a filename is a bytes string. For example, for a SyntaxError exception where the filename attribute is a bytes string. Cleanup also test_sys: * Sort imports. * Rename numruns global var to INTERN_NUMRUNS. * Add DisplayHookTest and ExceptHookTest test case classes. * Don't save/restore sys.stdout and sys.displayhook using setUp()/tearDown(): do it in each test method. * Test error case (call hook with no argument) after the success case. (cherry picked from commit f9b7457bd7f438263e0d2dd1f70589ad56a2585e) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37221: Add PyCode_NewWithPosOnlyArgs to be used internally and set ↵Miss Islington (bot)2019-07-012-8/+6
| | | | | | | | PyCode_New as a compatibility wrapper (GH-13959) (#14505) Add PyCode_NewEx to be used internally and set PyCode_New as a compatibility wrapper (cherry picked from commit 4a2edc34a405150d0b23ecfdcb401e7cf59f4650) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-37369: Fix initialization of sys members when launched via an app ↵Steve Dower2019-06-293-0/+35
| | | | | | container (GH-14467) sys._base_executable is now always defined on all platforms, and can be overridden through configuration. Also adds test.support.PythonSymlink to encapsulate platform-specific logic for symlinking sys.executable
* bpo-37363: Add audit events for a range of modules (GH-14301)Miss Islington (bot)2019-06-241-0/+5
| | | | | (cherry picked from commit 60419a7e96577cf783b3b45bf3984f9fb0d7ddff) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-35224: Bump the pyc magic number by 1 instead of by 10 in last ↵Miss Islington (bot)2019-06-231-1/+1
| | | | | | | modification (GH-14320) (cherry picked from commit b3ca7972c8d8c6479b6542ce28e0f7a6ebd5b8fe) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-35224: Bump the pyc magic number after the change in MAP_ADD (GH-14313)Miss Islington (bot)2019-06-221-121/+121
| | | | | (cherry picked from commit 663131a6e2c6c8b83e9f982d8c6ca38fc7c238b4) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-35224: Reverse evaluation order of key: value in dict comprehensions ↵Miss Islington (bot)2019-06-222-6/+6
| | | | | | | | | | (GH-14139) … as proposed in PEP 572; key is now evaluated before value. https://bugs.python.org/issue35224 (cherry picked from commit c8a35417db8853a253517a3e5190e174075c6384) Co-authored-by: Jörn Heissler <joernheissler@users.noreply.github.com>
* bpo-37316: mmap.mmap() passes the wrong variable to PySys_Audit() (GH-14152)Steve Dower2019-06-211-0/+1
| | | Also, add a missing call to va_end() in PySys_Audit().
* bpo-37267: Do not check for FILE_TYPE_CHAR in os.dup() on Windows (GH-14051) ↵Miss Islington (bot)2019-06-171-12/+5
| | | | | | | | | (GH-14140) On Windows, os.dup() no longer creates an inheritable fd when handling a character file. (cherry picked from commit 28fca0c422b425a6be43be31add0a5328c16b0b8) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-37289: Remove 'if False' handling in the peephole optimizer (GH-14099) ↵Miss Islington (bot)2019-06-151-9/+3
| | | | | | | (GH-14112) (cherry picked from commit 7a68f8c28bb78d957555a5001dac4df6345434a0) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071)Miss Islington (bot)2019-06-141-0/+5
| | | | | | | | | | | Fix a regression introduced by af8646c8054d0f4180a2013383039b6a472f9698 that was causing code of the form: if True and False: do_something() to be optimized incorrectly, eliminating the block. (cherry picked from commit 05f831865545b08c9a21cfb7773af58b76ec64cb) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-37077: Add native thread ID (TID) for AIX (GH-13624)Miss Islington (bot)2019-06-131-2/+7
| | | | | | | | This is the followup for issue36084 https://bugs.python.org/issue37077 (cherry picked from commit d0eeb936d8daf05d7d89f6935e3f4c0dee49c5be) Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
* bpo-37213: Handle negative line deltas correctly in the peephole optimizer ↵Miss Islington (bot)2019-06-134-4144/+4147
| | | | | | | | (GH-13969) The peephole optimizer was not optimizing correctly bytecode after negative deltas were introduced. This is due to the fact that some special values (255) were being searched for in both instruction pointer delta and line number deltas. (cherry picked from commit 3498c642f4e83f3d8e2214654c0fa8e0d51cebe5) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-37253: Remove PyAST_obj2mod_ex() function (GH-14020)Miss Islington (bot)2019-06-131-5/+0
| | | | | | | PyAST_obj2mod_ex() is similar to PyAST_obj2mod() with an additional 'feature_version' parameter which is unused. (cherry picked from commit 022ac0a497b668d8b15e34e582a6396ead1a35e1) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37253: Add _PyCompilerFlags_INIT macro (GH-14018)Miss Islington (bot)2019-06-134-24/+9
| | | | | | | | Add a new _PyCompilerFlags_INIT macro to initialize PyCompilerFlags variables, rather than initializing cf_flags and cf_feature_version explicitly in each variable. (cherry picked from commit 37d66d7d4bc7dbac9809d69966a774ebb32563be) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37160: Thread native ID NetBSD support (GH-13835)Miss Islington (bot)2019-06-121-0/+5
| | | | | (cherry picked from commit 5287022eeeb3c017d49fc8580b52e18377bf23f3) Co-authored-by: David Carlier <dcarlier@afilias.info>
* bpo-35766: compile(): rename feature_version parameter (GH-13994) (GH-14001)Victor Stinner2019-06-122-7/+12
| | | | | | | | Rename compile() feature_version parameter to _feature_version and convert it to a keyword-only parameter. Update also test_type_comments to pass feature_version as a tuple. (cherry picked from commit efdf6ca90f7702824e7aeee1ceca949e7c20288a)
* Revert "bpo-36818: Add PyInterpreterState.runtime field. (gh-13129)" (GH-13795)Victor Stinner2019-06-045-82/+82
| | | This reverts commit 396e0a8d9dc65453cb9d53500d0a620602656cfe.
* bpo-37146: disable opcache when Py_DEBUG is defined (GH-13787)Inada Naoki2019-06-031-0/+7
| | | | | --with-pydebug is commonly used to find memory leaks. But opcache makes it harder. So disable opcache when Py_DEBUG is defined.
* Revert "bpo-33608: Factor out a private, per-interpreter ↵Victor Stinner2019-06-034-285/+175
| | | | | _Py_AddPendingCall(). (gh-13714)" (GH-13780) This reverts commit 6a150bcaeb190d1731b38ab9c7a5d1a352847ddc.
* bpo-37087: Adding native ID support for OpenBSD (GH-13654)David Carlier2019-06-031-0/+5
|
* bpo-26219: remove unused code (GH-13775)Inada Naoki2019-06-031-3/+0
| | | | This code was for deoptimization, which is removed from PR-12884.
* bpo-26219: per opcode cache for LOAD_GLOBAL (GH-12884)Inada Naoki2019-06-032-1/+145
| | | | | | This patch implements per opcode cache mechanism, and use it in only LOAD_GLOBAL opcode. Based on Yury's opcache3.patch in bpo-26219.
* bpo-35814: Allow unpacking in r.h.s of annotated assignment expressions ↵Pablo Galindo2019-06-032-2/+2
| | | | (GH-13760)
* bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-06-014-176/+285
| | | | (gh-13714)
* Fix compiler warnings in the pystrehex module (GH-13730)Pablo Galindo2019-06-011-2/+2
|
* bpo-37122: Make co->co_argcount represent the total number of positonal ↵Pablo Galindo2019-06-012-35/+19
| | | | arguments in the code object (GH-13726)
* bpo-36818: Add PyInterpreterState.runtime field. (gh-13129)Eric Snow2019-06-015-82/+82
| | | https://bugs.python.org/issue36818
* bpo-37115: Support annotations in positional-only arguments (GH-13698)Pablo Galindo2019-05-311-0/+2
|
* bpo-37112: Allow compile to work on AST with positional only arguments with ↵Pablo Galindo2019-05-311-1/+1
| | | | defaults (GH-13697)
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-314-12/+12
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36974: rename _FastCallKeywords -> _Vectorcall (GH-13653)Jeroen Demeyer2019-05-301-4/+4
|
* bpo-20602: Do not clear sys.flags and sys.float_info during shutdown (GH-8096)Zackery Spytz2019-05-301-2/+0
| | | There is no need to clear these immutable objects during shutdown.
* bpo-22385: Support output separators in hex methods. (#13578)Gregory P. Smith2019-05-291-10/+80
| | | | | | | | | | | | | | | | | | * bpo-22385: Support output separators in hex methods. Also in binascii.hexlify aka b2a_hex. The underlying implementation behind all hex generation in CPython uses the same pystrhex.c implementation. This adds support to bytes, bytearray, and memoryview objects. The binascii module functions exist rather than being slated for deprecation because they return bytes rather than requiring an intermediate step through a str object. This change was inspired by MicroPython which supports sep in its binascii implementation (and does not yet support the .hex methods). https://bugs.python.org/issue22385
* bpo-36974: implement PEP 590 (GH-13185)Jeroen Demeyer2019-05-294-59/+41
| | | | | Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be> Co-authored-by: Mark Shannon <mark@hotpy.org>
* bpo-37070: Cleanup fstring debug handling (GH-13607)Eric V. Smith2019-05-291-27/+18
| | | | * Clean up some comments, fix potential memory leaks, clarify literal and expr_text.
* bpo-37072: Fix crash in PyAST_FromNodeObject() when flags is NULL (#13634)Guido van Rossum2019-05-281-1/+1
| | | | | I'm confident that this fixes the reported crash. flags=NULL is treated as using the latest minor version. https://bugs.python.org/issue37072
* bpo-37001: Makes symtable.symtable have parity with compile for input (#13483)Dino Viehland2019-05-282-56/+63
| | | | | | | * Makes symtable.symtable have parity for accepted datatypes for source code as compile() * Add NEWS blurb
* bpo-36829: sys.excepthook and sys.unraisablehook flush (GH-13620)Victor Stinner2019-05-282-0/+19
| | | | | | | sys.excepthook() and sys.unraisablehook() now explicitly flush the file (usually sys.stderr). If file.flush() fails, sys.excepthook() silently ignores the error, whereas sys.unraisablehook() logs the new exception.
* bpo-36900: Fix compilation on HP-UX (GH-13614)Victor Stinner2019-05-281-0/+1
| | | | dynload_hpux.c: add #include "pycore_pystate.h" for _PyInterpreterState_GET_UNSAFE().
* bpo-36933: Remove sys.set_coroutine_wrapper (marked for removal in 3.8) ↵Matthias Bussonnier2019-05-284-129/+1
| | | | | | | | | | (GH-13577) It has been documented as deprecated and to be removed in 3.8; From a comment on another thread – which I can't find ; leave get_coro_wrapper() for now, but always return `None`. https://bugs.python.org/issue36933
* bpo-1230540: Add threading.excepthook() (GH-13515)Victor Stinner2019-05-271-14/+24
| | | | | | | | | | | | | | | | | | | Add a new threading.excepthook() function which handles uncaught Thread.run() exception. It can be overridden to control how uncaught exceptions are handled. threading.ExceptHookArgs is not documented on purpose: it should not be used directly. * threading.excepthook() and threading.ExceptHookArgs. * Add _PyErr_Display(): similar to PyErr_Display(), but accept a 'file' parameter. * Add _thread._excepthook(): C implementation of the exception hook calling _PyErr_Display(). * Add _thread._ExceptHookArgs: structseq type. * Add threading._invoke_excepthook_wrapper() which handles the gory details to ensure that everything remains alive during Python shutdown. * Add unit tests.
* bpo-37050: Remove expr_text from FormattedValue ast node, use Constant node ↵Eric V. Smith2019-05-274-89/+52
| | | | | instead (GH-13597) When using the "=" debug functionality of f-strings, use another Constant node (or a merged constant node) instead of adding expr_text to the FormattedValue node.
* bpo-36763: Implement the PEP 587 (GH-13592)Victor Stinner2019-05-2714-1131/+1106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a whole new documentation page: "Python Initialization Configuration" * PyWideStringList_Append() return type is now PyStatus, instead of int * PyInterpreterState_New() now calls PyConfig_Clear() if PyConfig_InitPythonConfig() fails. * Rename files: * Python/coreconfig.c => Python/initconfig.c * Include/cpython/coreconfig.h => Include/cpython/initconfig.h * Include/internal/: pycore_coreconfig.h => pycore_initconfig.h * Rename structures * _PyCoreConfig => PyConfig * _PyPreConfig => PyPreConfig * _PyInitError => PyStatus * _PyWstrList => PyWideStringList * Rename PyConfig fields: * use_module_search_paths => module_search_paths_set * module_search_path_env => pythonpath_env * Rename PyStatus field: _func => func * PyInterpreterState: rename core_config field to config * Rename macros and functions: * _PyCoreConfig_SetArgv() => PyConfig_SetBytesArgv() * _PyCoreConfig_SetWideArgv() => PyConfig_SetArgv() * _PyCoreConfig_DecodeLocale() => PyConfig_SetBytesString() * _PyInitError_Failed() => PyStatus_Exception() * _Py_INIT_ERROR_TYPE_xxx enums => _PyStatus_TYPE_xxx * _Py_UnixMain() => Py_BytesMain() * _Py_ExitInitError() => Py_ExitStatusException() * _Py_PreInitializeFromArgs() => Py_PreInitializeFromBytesArgs() * _Py_PreInitializeFromWideArgs() => Py_PreInitializeFromArgs() * _Py_PreInitialize() => Py_PreInitialize() * _Py_RunMain() => Py_RunMain() * _Py_InitializeFromConfig() => Py_InitializeFromConfig() * _Py_INIT_XXX() => _PyStatus_XXX() * _Py_INIT_FAILED() => _PyStatus_EXCEPTION() * Rename 'err' PyStatus variables to 'status' * Convert RUN_CODE() macro to config_run_code() static inline function * Remove functions: * _Py_InitializeFromArgs() * _Py_InitializeFromWideArgs() * _PyInterpreterState_GetCoreConfig()