summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-38304: Remove PyConfig.struct_size (GH-16500)Victor Stinner2019-09-302-12/+4
| | | | | For now, we'll rely on the fact that the config structures aren't covered by the stable ABI. We may revisit this in the future if we further explore the idea of offering a stable embedding API.
* bpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in parallel ↵Miss Islington (bot)2019-09-301-0/+2
| | | | | | | (GH-7468) (#16486) (cherry picked from commit fc4a044a3c54ce21e9ed150f7d769fb479d34c49) Co-authored-by: Yury Selivanov <yury@magic.io>
* bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)Miss Islington (bot)2019-09-293-3/+6
| | | | | | | | | | | | Fix warnings options priority: PyConfig.warnoptions has the highest priority, as stated in the PEP 587. * Document options order in PyConfig.warnoptions documentation. * Make PyWideStringList_INIT macro private: replace "Py" prefix with "_Py". * test_embed: add test_init_warnoptions(). (cherry picked from commit fb4ae152a9930f0e00cae8b2807f534058cf341a) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-38304: Add PyConfig.struct_size (GH-16451) (GH-16453)Victor Stinner2019-09-282-13/+16
| | | | | | | | | | | | | | | | | | | Add a new struct_size field to PyPreConfig and PyConfig structures to allow to modify these structures in the future without breaking the backward compatibility. * Replace private _config_version field with public struct_size field in PyPreConfig and PyConfig. * Public PyPreConfig_InitIsolatedConfig() and PyPreConfig_InitPythonConfig() return type becomes PyStatus, instead of void. * Internal _PyConfig_InitCompatConfig(), _PyPreConfig_InitCompatConfig(), _PyPreConfig_InitFromConfig(), _PyPreConfig_InitFromPreConfig() return type becomes PyStatus, instead of void. * Remove _Py_CONFIG_VERSION * Update the Initialization Configuration documentation. (cherry picked from commit 441b10cf2855955c86565f8d59e72c2efc0f0a57)
* [3.8] bpo-38234: Backport init path config changes from master (GH-16423)Victor Stinner2019-09-261-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-38234: Py_SetPath() uses the program full path (GH-16357) Py_SetPath() now sets sys.executable to the program full path (Py_GetProgramFullPath()), rather than to the program name (Py_GetProgramName()). Fix also memory leaks in pathconfig_set_from_config(). (cherry picked from commit 1ce152a42eaa917d7763bce93f1e1ca72530d7ca) * bpo-38234: Add tests for Python init path config (GH-16358) (cherry picked from commit bb6bf7d342b4503a6227fd209fac934905b6a1aa) * bpo-38234: test_embed: test pyvenv.cfg and pybuilddir.txt (GH-16366) Add test_init_pybuilddir() and test_init_pyvenv_cfg() to test_embed to test pyvenv.cfg and pybuilddir.txt configuration files. Fix sysconfig._generate_posix_vars(): pybuilddir.txt uses UTF-8 encoding, not ASCII. (cherry picked from commit 52ad33abbfb6637d74932617c7013bae0ccf6e32) * bpo-38234: Cleanup getpath.c (GH-16367) * search_for_prefix() directly calls reduce() if found is greater than 0. * Add calculate_pybuilddir() subfunction. * search_for_prefix(): add path string buffer for readability. * Fix some error handling code paths: release resources on error. * calculate_read_pyenv(): rename tmpbuffer to filename. * test.pythoninfo now also logs windows.dll_path (cherry picked from commit 221fd84703c545408bbb4a6e0b58459651331f5c) * bpo-38234: Fix test_embed pathconfig tests (GH-16390) bpo-38234: On macOS and FreeBSD, the temporary directory can be symbolic link. For example, /tmp can be a symbolic link to /var/tmp. Call realpath() to resolve all symbolic links. (cherry picked from commit 00508a7407d7d300b487532e2271534b20e378a7) * bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402) * Add test_embed.test_init_setpath_config(): test Py_SetPath() with PyConfig. * test_init_setpath() and test_init_setpythonhome() no longer call Py_SetProgramName(), but use the default program name. * _PyPathConfig: isolated, site_import and base_executable fields are now only available on Windows. * If executable is set explicitly in the configuration, ignore calculated base_executable: _PyConfig_InitPathConfig() copies executable to base_executable. * Complete path config documentation. (cherry picked from commit 8bf39b606ef7b02c0279a80789f3c4824b0da5e9) * bpo-38234: Complete init config documentation (GH-16404) (cherry picked from commit 88feaecd46a8f427e30ef7ad8cfcddfe392a2402) * bpo-38234: Fix test_embed.test_init_setpath_config() on FreeBSD (GH-16406) Explicitly preinitializes with a Python preconfiguration to avoid Py_SetPath() implicit preinitialization with a compat preconfiguration. Fix also test_init_setpath() and test_init_setpythonhome() on macOS: use self.test_exe as the executable (and base_executable), rather than shutil.which('python3'). (cherry picked from commit 49d99f01e6e51acec5ca57a02e857f0796bc418b) * bpo-38234: Py_Initialize() sets global path configuration (GH-16421) * Py_InitializeFromConfig() now writes PyConfig path configuration to the global path configuration (_Py_path_config). * Add test_embed.test_get_pathconfig(). * Fix typo in _PyWideStringList_Join(). (cherry picked from commit 12f2f177fc483723406d7917194e7f655a20631b)
* closes bpo-38253: Fix typo of Py_SET_ERANGE_IF_OVERFLOW in pyport.h. (GH-16230)Miss Islington (bot)2019-09-241-1/+1
| | | | | (cherry picked from commit 4346bad3321699d49a45e3446270b57726ab5c8f) Co-authored-by: Hai Shi <shihai1992@gmail.com>
* bpo-38236: Dump path config at first import error (GH-16300) (GH-16332)Victor Stinner2019-09-232-1/+2
| | | | | | Python now dumps path configuration if it fails to import the Python codecs of the filesystem and stdio encodings. (cherry picked from commit fcdb027234566c4d506d6d753c7d5638490fb088)
* [3.8] bpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298) ↵Victor Stinner2019-09-212-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | (GH-16313) * bpo-38234: Remove _PyPathConfig.dll_path (GH-16307) The DLL path is not computed from any user configuration and cannot be configured by PyConfig. Instead, add a new _Py_dll_path global variable. Remove _PyConfig_SetPathConfig(): replaced with _PyPathConfig_Init(). Py_Initialize() now longer sets the "global path configuration", but only initialize _Py_dll_path. (cherry picked from commit c422167749f92d4170203e996a2c619c818335ea) * bpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298) * If Py_SetPath() has been called, _PyConfig_InitPathConfig() now uses its value. * Py_Initialize() now longer copies path configuration from PyConfig to the global path configuration (_Py_path_config). (cherry picked from commit e267793aa4101b2771ed0e66aaff5743d23f59af)
* bpo-38205: Py_UNREACHABLE() calls Py_FatalError() (GH-16290) (GH-16306)Victor Stinner2019-09-201-1/+2
| | | (cherry picked from commit b1542583bee204130934c2b90684041e29378250)
* Fix _PyTraceMalloc_Fini() definition (GH-16259) (GH-16278)Miss Islington (bot)2019-09-191-1/+1
| | | | | | The function return type is void, not int. (cherry picked from commit d299b8b47d9dbea8fec2c2abcb6c32ad32f5f4d1) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* [3.8] bpo-38070: Py_FatalError() logs runtime state (GH-16258)Victor Stinner2019-09-181-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-38070: _Py_DumpTraceback() writes <no Python frame> (GH-16244) When a Python thread has no frame, _Py_DumpTraceback() and _Py_DumpTracebackThreads() now write "<no Python frame>", rather than writing nothing. (cherry picked from commit 8fa3e1740b3f03ea65ddb68411c2238c5f98eec2) * bpo-38070: Enhance _PyObject_Dump() (GH-16243) _PyObject_Dump() now dumps the object address for freed objects and objects with ob_type=NULL. (cherry picked from commit b39afb78768418d9405c4b528c80fa968ccc974d) * bpo-38070: Add _PyRuntimeState.preinitializing (GH-16245) Add _PyRuntimeState.preinitializing field: set to 1 while Py_PreInitialize() is running. _PyRuntimeState: rename also pre_initialized field to preinitialized. (cherry picked from commit d3b904144e86e2442961de6a7dccecbe133d5c6d) * bpo-38070: Py_FatalError() logs runtime state (GH-16246) (cherry picked from commit 1ce16fb0977283ae42a9f8917bbca5f44aa69324)
* [3.8] bpo-38005: Fixed comparing and creating of InterpreterID and ↵Serhiy Storchaka2019-09-141-2/+0
| | | | | | | | | | | | | | ChannelID. (GH-15652) (GH-16145) * Fix a crash in comparing with float (and maybe other crashes). * They are now never equal to strings and non-integer numbers. * Comparison with a large number no longer raises OverflowError. * Arbitrary exceptions no longer silenced in constructors and comparisons. * TypeError raised in the constructor contains now the name of the type. * Accept only ChannelID and int-like objects in channel functions. * Accept only InterpreterId, int-like objects and str in the InterpreterId constructor. * Accept int-like objects, not just int in interpreter related functions. (cherry picked from commit bf169915ecdd42329726104278eb723a7dda2736)
* Fix typos mostly in comments, docs and test names (GH-15209)Miss Islington (bot)2019-08-301-1/+1
| | | | | (cherry picked from commit 39d87b54715197ca9dcb6902bb43461c0ed701a2) Co-authored-by: Min ho Kim <minho42@gmail.com>
* Post v3.8.0b4Łukasz Langa2019-08-301-1/+1
|
* Python 3.8.0b4v3.8.0b4Łukasz Langa2019-08-291-2/+2
|
* [3.8] bpo-37034: Display argument name on errors with keyword arguments with ↵Serhiy Storchaka2019-08-291-1/+1
| | | | | | | Argument Clinic. (GH-13593). (GH-15599) (cherry picked from commit 4901fe274bc82b95dc89bcb3de8802a3dfedab32) Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
* bpo-36763: Make Py_BytesMain() public (GH-15532)Miss Islington (bot)2019-08-262-2/+2
| | | | | | | Declare Py_BytesMain() in Include/pylifecycle.h, rather in Include/internal/pycore_pylifecycle.h. (cherry picked from commit 9a943b4ce13fac26873b8100e89c818c5c47ac4b) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* [3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details ↵Nick Coghlan2019-08-252-1/+3
| | | | | | | | | | | | | | | | | | | (GH-15491) - drop TargetScopeError in favour of raising SyntaxError directly as per the updated PEP 572 - comprehension iteration variables are explicitly local, but named expression targets in comprehensions are nonlocal or global. Raise SyntaxError as specified in PEP 572 - named expression targets in the outermost iterable of a comprehension have an ambiguous target scope. Avoid resolving that question now by raising SyntaxError. PEP 572 originally required this only for cases where the bound name conflicts with the iteration variable in the comprehension, but CPython can't easily restrict the exception to that case (as it doesn't know the target variable names when visiting the outermost iterator expression) (cherry picked from commit 5dbe0f59b7a4f39c7c606b48056bc29e406ebf78)
* bpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431) (GH-15435)Victor Stinner2019-08-231-0/+2
| | | | | | | | | | | | PyConfig_Read() is now responsible to handle early calls to PySys_AddXOption() and PySys_AddWarnOption(). Options added by PySys_AddXOption() are now handled the same way than PyConfig.xoptions and command line -X options. For example, PySys_AddXOption(L"faulthandler") enables faulthandler as expected. (cherry picked from commit 120b707a6d43452e067daa55a8fdca69f9424abc)
* bpo-36763: Implement PyWideStringList_Insert() of PEP 587 (GH-15423)Miss Islington (bot)2019-08-231-0/+3
| | | | | (cherry picked from commit 3842f2997fbd4dc840986aad2bb94656815e243b) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* Fix _PyTime_MIN/MAX values (GH-15384) (GH-15426)Victor Stinner2019-08-231-2/+2
| | | | | | _PyTime_t type is defined as int64_t, and so min/max are INT64_MIN/INT64_MAX, not PY_LLONG_MIN/PY_LLONG_MAX. (cherry picked from commit 8e76c456226438f2e4931ce7baf05ac8faae34a1)
* bpo-37834: Normalise handling of reparse points on Windows (GH-15370)Steve Dower2019-08-211-0/+1
| | | | | | | | | | bpo-37834: Normalise handling of reparse points on Windows * ntpath.realpath() and nt.stat() will traverse all supported reparse points (previously was mixed) * nt.lstat() will let the OS traverse reparse points that are not name surrogates (previously would not traverse any reparse point) * nt.[l]stat() will only set S_IFLNK for symlinks (previous behaviour) * nt.readlink() will read destinations for symlinks and junction points only bpo-1311: os.path.exists('nul') now returns True on Windows * nt.stat('nul').st_mode is now S_IFCHR (previously was an error)
* Post v3.8.0b3Łukasz Langa2019-07-291-1/+1
|
* Python 3.8.0b3v3.8.0b3Łukasz Langa2019-07-291-2/+2
|
* [3.8] bpo-36974: separate vectorcall functions for each calling convention ↵Jeroen Demeyer2019-07-232-8/+0
| | | | (GH-13781) (#14782)
* bpo-37593: Swap the positions of posonlyargs and args in the constructor of ↵Miss Islington (bot)2019-07-141-2/+2
| | | | | | | | ast.parameters nodes (GH-14778) https://bugs.python.org/issue37593 (cherry picked from commit cd6e83b4810549c308ab2d7315dbab526e35ccf6) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* Post v3.8.0b2Łukasz Langa2019-07-041-1/+1
|
* Python 3.8.0b2v3.8.0b2Łukasz Langa2019-07-041-2/+2
|
* bpo-36763: Add PyConfig_SetWideStringList() (GH-14444)Miss Islington (bot)2019-07-011-0/+3
| | | | | (cherry picked from commit 36242fd871d0f0977e720d4fae5700774bd8c09a) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37221: Add PyCode_NewWithPosOnlyArgs to be used internally and set ↵Miss Islington (bot)2019-07-011-0/+5
| | | | | | | | 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-292-4/+7
| | | | | | 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
* [3.8] bpo-37250: put back tp_print for backwards compatibility (GH-14193)Jeroen Demeyer2019-06-251-0/+3
| | | | | | This is a 3.8-only compatibility measure for third-party Cython-based sdists. https://bugs.python.org/issue37250
* bpo-37189: Export old PyRun_XXX() functions (GH-14142)Miss Islington (bot)2019-06-171-2/+18
| | | | | | | | Many PyRun_XXX() functions like PyRun_String() were no longer exported in libpython38.dll by mistake. Export them again to fix the ABI compatibiliy. (cherry picked from commit 343ed0ffe0d5ddd4f17c31e14a656a04ac7dfc19) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37077: Add native thread ID (TID) for AIX (GH-13624)Miss Islington (bot)2019-06-131-1/+1
| | | | | | | | 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-37253: Remove PyAST_obj2mod_ex() function (GH-14020)Miss Islington (bot)2019-06-131-1/+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-131-0/+3
| | | | | | | | 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-1/+1
| | | | | (cherry picked from commit 5287022eeeb3c017d49fc8580b52e18377bf23f3) Co-authored-by: David Carlier <dcarlier@afilias.info>
* bpo-37191: Avoid declaration-after-statement in header included from ↵Petr Viktorin2019-06-071-4/+7
| | | | Python.h (GH-13887)
* Post v3.8.0b1Łukasz Langa2019-06-041-1/+1
|
* Python 3.8.0b1v3.8.0b1Łukasz Langa2019-06-041-3/+3
|
* Revert "bpo-36818: Add PyInterpreterState.runtime field. (gh-13129)" (GH-13795)Victor Stinner2019-06-044-15/+20
| | | This reverts commit 396e0a8d9dc65453cb9d53500d0a620602656cfe.
* Revert "bpo-33608: Factor out a private, per-interpreter ↵Victor Stinner2019-06-032-18/+7
| | | | | _Py_AddPendingCall(). (gh-13714)" (GH-13780) This reverts commit 6a150bcaeb190d1731b38ab9c7a5d1a352847ddc.
* bpo-37087: Adding native ID support for OpenBSD (GH-13654)David Carlier2019-06-031-1/+1
|
* bpo-26219: per opcode cache for LOAD_GLOBAL (GH-12884)Inada Naoki2019-06-033-0/+47
| | | | | | 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-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-06-012-7/+18
| | | | (gh-13714)
* bpo-36818: Add PyInterpreterState.runtime field. (gh-13129)Eric Snow2019-06-014-20/+15
| | | https://bugs.python.org/issue36818
* bpo-36974: rename _FastCallKeywords -> _Vectorcall (GH-13653)Jeroen Demeyer2019-05-303-3/+3
|
* bpo-36974: remove _PyObject_HasFastCall (GH-13460)Jeroen Demeyer2019-05-301-4/+0
|
* bpo-32388: Remove cross-version binary compatibility requirement in tp_flags ↵Antoine Pitrou2019-05-291-8/+10
| | | | | | | | (GH-4944) It is now allowed to add new fields at the end of the PyTypeObject struct without having to allocate a dedicated compatibility flag in tp_flags. This will reduce the risk of running out of bits in the 32-bit tp_flags value.
* bpo-22385: Support output separators in hex methods. (#13578)Gregory P. Smith2019-05-291-0/+3
| | | | | | | | | | | | | | | | | | * 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