summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36301: Add _PyPreCmdline internal API (GH-12458)Victor Stinner2019-03-201-0/+24
| | | | _PyCoreConfig_ReadFromArgv() now reuses the code parsing command line options from preconfig.c.
* bpo-36301: Add _PyRuntime.pre_initialized (GH-12457)Victor Stinner2019-03-202-2/+14
| | | | | | | | | * Add _PyRuntime.pre_initialized: set to 1 when Python is pre-initialized * Add _Py_PreInitialize() and _Py_PreInitializeFromPreConfig(). * _PyCoreConfig_Read() now calls _Py_PreInitialize(). * Move _PyPreConfig_GetGlobalConfig() and _PyCoreConfig_GetGlobalConfig() calls from main.c to preconfig.c and coreconfig.c.
* bpo-36236: Handle removed cwd at Python init (GH-12424)Victor Stinner2019-03-191-1/+3
| | | | | | | | At Python initialization, the current directory is no longer prepended to sys.path if it has been removed. Rename _PyPathConfig_ComputeArgv0() to _PyPathConfig_ComputeSysPath0() to avoid confusion between argv[0] and sys.path[0].
* bpo-36356: pymain_free() calls _PyRuntime_Finalize() (GH-12435)Victor Stinner2019-03-191-0/+2
| | | | Ensure that _PyRuntime_Finalize() is always call. This change fix a few memory leaks when running "python3 -V".
* bpo-36356: Release Unicode interned strings on Valgrind (#12431)Victor Stinner2019-03-191-2/+0
| | | | | | | | | | | When Python is compiled with Valgrind support, release Unicode interned strings at exit in _PyUnicode_Fini(). * Rename _Py_ReleaseInternedUnicodeStrings() to unicode_release_interned() and make it private. * unicode_release_interned() is now called from _PyUnicode_Fini(): it must be called with a running Python thread state for TRASHCAN, it cannot be called from pymain_free(). * Don't display statistics on interned strings at exit anymore
* bpo-36301: Error if decoding pybuilddir.txt fails (GH-12422)Victor Stinner2019-03-191-1/+2
| | | | | | | | Python initialization now fails if decoding pybuilddir.txt configuration file fails at startup. _PyPathConfig_Calculate() now reports memory allocation failure and decoding error on decoding pybuilddir.txt content from UTF-8/surrogateescape.
* bpo-36352: Clarify fileutils.h documentation (GH-12406)Victor Stinner2019-03-181-3/+9
| | | | | | | The last parameter of _Py_wreadlink(), _Py_wrealpath() and _Py_wgetcwd() is a length, not a size: number of characters including the trailing NUL character. Enhance also documentation of error conditions.
* Fix typo in _PyObject_FastCallDict documentation (GH-12383)Rémi Lapeyre2019-03-181-1/+1
|
* bpo-36297: remove "unicode_internal" codec (GH-12342)Inada Naoki2019-03-181-9/+0
|
* bpo-36124: Add PyInterpreterState.dict. (gh-12132)Eric Snow2019-03-152-2/+10
|
* bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as ↵Eric Snow2019-03-154-54/+102
| | | | necessary). (gh-12359)
* bpo-33608: Deal with pending calls relative to runtime shutdown. (gh-12246)Eric Snow2019-03-151-0/+3
|
* bpo-36301: Add _PyWstrList structure (GH-12343)Victor Stinner2019-03-154-41/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace messy _Py_wstrlist_xxx() functions with a new clean _PyWstrList structure and new _PyWstrList_xxx() functions. Changes: * Add _PyCoreConfig.use_module_search_paths to decide if _PyCoreConfig.module_search_paths should be computed or not, to support empty search path list. * _PyWstrList_Clear() sets length to 0 and items to NULL, whereas _Py_wstrlist_clear() only freed memory. * _PyWstrList_Append() returns an int, whereas _Py_wstrlist_append() returned _PyInitError. * _PyWstrList uses Py_ssize_t for the length, instead of int. * Replace (int, wchar_t**) with _PyWstrList in: * _PyPreConfig * _PyCoreConfig * _PyPreCmdline * _PyCmdline * Replace "int orig_argv; wchar_t **orig_argv;" with "_PyWstrList orig_argv". * _PyCmdline and _PyPreCmdline now also copy wchar_argv. * Rename _PyArgv_Decode() to _PyArgv_AsWstrList(). * PySys_SetArgvEx() now pass the fixed (argc, argv) to _PyPathConfig_ComputeArgv0() (don't pass negative argc or NULL argv). * _PyOS_GetOpt() uses Py_ssize_t
* bpo-36127: Argument Clinic: inline parsing code for keyword parameters. ↵Serhiy Storchaka2019-03-141-0/+12
| | | | (GH-12058)
* bpo-36280: Add Constant.kind field (GH-12295)Guido van Rossum2019-03-131-3/+4
| | | | | | | | | | | | | | The value is a string for string and byte literals, None otherwise. It is 'u' for u"..." literals, 'b' for b"..." literals, '' for "..." literals. The 'r' (raw) prefix is ignored. Does not apply to f-strings. This appears sufficient to make mypy capable of using the stdlib ast module instead of typed_ast (assuming a mypy patch I'm working on). WIP: I need to make the tests pass. @ilevkivskyi @serhiy-storchaka https://bugs.python.org/issue36280
* Remove d_initial from the parser as it is unused (GH-12212)tyomitch2019-03-091-1/+0
| | | d_initial, the first state of a particular DFA in the parser has always been initialized to 0 in the old pgen as well as the new pgen. As this value is not used and the first state of each DFA is assumed to be the first element in the array representing it, remove d_initial from the parser to reduce complexity.
* bpo-33608: Make sure locks in the runtime are properly re-created. (gh-12245)Eric Snow2019-03-091-0/+1
|
* bpo-33608: Minor cleanup related to pending calls. (gh-12247)Eric Snow2019-03-092-1/+4
|
* Fix the Py_atomic_* macros. (#12240)Eric Snow2019-03-081-24/+24
| | | The macros were working only because our usage happened to parse correctly. Changing that usage (e.g. with pointers) would break the macros. This fixes that.
* bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086)Guido van Rossum2019-03-074-4/+9
| | | | | | | This adds a `feature_version` flag to `ast.parse()` (documented) and `compile()` (hidden) that allow tweaking the parser to support older versions of the grammar. In particular if `feature_version` is 5 or 6, the hacks for the `async` and `await` keyword from PEP 492 are reinstated. (For 7 or higher, these are unconditionally treated as keywords, but they are still special tokens rather than `NAME` tokens that the parser driver recognizes.) https://bugs.python.org/issue35975
* bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)Jeremy Kloth2019-03-061-1/+1
| | | Change PyDTrace_GC_DONE() argument type from int to Py_ssize_t.
* bpo-36142: _PyPreConfig_Read() sets LC_CTYPE (GH-12188)Victor Stinner2019-03-061-1/+0
| | | | | | | * _PyPreConfig_Read() now sets temporarily LC_CTYPE to the user preferred locale, as _PyPreConfig_Write() will do permanentely. * Fix _PyCoreConfig_Clear(): clear run_xxx attributes * _Py_SetArgcArgv() doesn't have to be exported * _PyCoreConfig_SetGlobalConfig() no longer applies preconfig
* bpo-36142: Add _PyPreConfig_SetAllocator() (GH-12187)Victor Stinner2019-03-062-3/+1
| | | | | | | | | | | * _PyPreConfig_Write() now reallocates the pre-configuration with the new memory allocator. * It is no longer needed to force the "default raw memory allocator" to clear pre-configuration and core configuration. Simplify the code. * _PyPreConfig_Write() now does nothing if called after Py_Initialize(): no longer check if the allocator is the same. * Remove _PyMem_GetDebugAllocatorsName(): dev mode sets again allocator to "debug".
* bpo-36142: _PyPreConfig_Write() sets the allocator (GH-12186)Victor Stinner2019-03-051-1/+1
| | | | | | | * _PyPreConfig_Write() now sets the memory allocator. * _PyPreConfig_Write() gets a return type: _PyInitError. * _Py_InitializeCore() now reads and writes the pre-configuration (set the memory allocator, configure the locale) before reading and writing the core configuration.
* bpo-36142: Add _PyMem_GetDebugAllocatorsName() (GH-12185)Victor Stinner2019-03-051-0/+2
| | | | | The development mode now uses the effective name of the debug memory allocator ("pymalloc_debug" or "malloc_debug"). So the name doesn't change after setting the memory allocator.
* bpo-36187: Remove NamedStore. (GH-12167)Serhiy Storchaka2019-03-051-1/+1
| | | | | NamedStore has been replaced with Store. The difference between NamedStore and Store is handled when precess the NamedExpr node one level upper.
* bpo-36142: Add _PyPreConfig.allocator (GH-12181)Victor Stinner2019-03-051-3/+3
| | | | | | * Move 'allocator' and 'dev_mode' fields from _PyCoreConfig to _PyPreConfig. * Fix InitConfigTests of test_embed: dev_mode sets allocator to "debug", add a new tests for env vars with dev mode enabled.
* bpo-36142: Add _PyPreConfig.utf8_mode (GH-12174)Victor Stinner2019-03-052-22/+45
| | | | | | | | | | | | * Move following fields from _PyCoreConfig to _PyPreConfig: * coerce_c_locale * coerce_c_locale_warn * legacy_windows_stdio * utf8_mode * _PyPreConfig_ReadFromArgv() is now responsible to choose the filesystem encoding * _PyPreConfig_Write() now sets the LC_CTYPE locale
* bpo-36142: Add _PyPreConfig_ReadFromArgv() (GH-12173)Victor Stinner2019-03-052-5/+8
| | | | The new function is now responsible to parse -E and -I command line arguments.
* bpo-36142: Add _PyPreConfig structure (GH-12172)Victor Stinner2019-03-052-12/+36
| | | | | | * Add _PyPreConfig structure * Move 'ignored' and 'use_environment' fields from _PyCoreConfig to _PyPreConfig * Add a new "_PyPreConfig preconfig;" field to _PyCoreConfig
* Revert: bpo-33608: Factor out a private, per-interpreter ↵Victor Stinner2019-03-047-147/+84
| | | | | | | | | | | | | | | | | | | _Py_AddPendingCall(). (GH-11617) (GH-12159) * Revert "bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as necessary). (#12003)" This reverts commit bcfa450f210074e16feb761ae5b3e966a2532fcf. * Revert "bpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. (gh-12062)" This reverts commit bda918bf65a88560ec453aaba0758a9c0d49b449. * Revert "bpo-33608: Use _Py_AddPendingCall() in _PyCrossInterpreterData_Release(). (gh-12024)" This reverts commit b05b711a2cef6c6c381e01069dedac372e0b9fb2. * Revert "bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617)" This reverts commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465.
* bpo-31904: Add encoding support for VxWorks RTOS (GH-12051)pxinwr2019-03-041-2/+2
| | | | | | | | Use UTF-8 as the system encoding on VxWorks. The main reason are: 1. The locale is frequently misconfigured. 2. Missing some functions to deal with locale in VxWorks C library.
* bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as ↵Eric Snow2019-03-014-54/+102
| | | | necessary). (#12003)
* bpo-35808: Retire pgen and use pgen2 to generate the parser (GH-11814)Pablo Galindo2019-03-013-39/+0
| | | | | Pgen is the oldest piece of technology in the CPython repository, building it requires various #if[n]def PGEN hacks in other parts of the code and it also depends more and more on CPython internals. This commit removes the old pgen C code and replaces it for a new version implemented in pure Python. This is a modified and adapted version of lib2to3/pgen2 that can generate grammar files compatibles with the current parser. This commit also eliminates all the #ifdef and code branches related to pgen, simplifying the code and making it more maintainable. The regen-grammar step now uses $(PYTHON_FOR_REGEN) that can be any version of the interpreter, so the new pgen code maintains compatibility with older versions of the interpreter (this also allows regenerating the grammar with the current CI solution that uses Python3.5). The new pgen Python module also makes use of the Grammar/Tokens file that holds the token specification, so is always kept in sync and avoids having to maintain duplicate token definitions.
* bpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. ↵Eric Snow2019-03-011-24/+24
| | | | | (gh-12062) This includes fixes to various _Py_atomic_* macros.
* bpo-36142: Add preconfig.c (GH-12128)Victor Stinner2019-03-013-7/+15
| | | | | * Add _PyArgv_Decode() function * Move _Py_ClearFileSystemEncoding() and _Py_SetFileSystemEncoding() to preconfig.c.
* bpo-36142: Move command line parsing to coreconfig.c (GH-12123)Victor Stinner2019-03-013-14/+36
| | | | | | | | | | | | | | | * Add _PyCoreConfig_ReadFromArgv() function which parses command line options: move code from main.c to coreconfig.c. * Add _PyCoreConfig_Write() to write the new configuration: coerce the LC_CTYPE locale, set Py_xxx global configuration variables, etc. * _PyCoreConfig_ReadFromArgv() now only changes the LC_CTYPE locale temporarily. _PyCoreConfig_Write() becomes responsible to set the LC_CTYPE locale. * Add _Py_SetArgcArgv() and _Py_ClearArgcArgv() functions * Rename many "pymain_xxx()" functions * Add "const" to some function parameters * Reorganize main.c to declare functions in the order in which they are called.
* bpo-36142: Remove _PyMain structure (GH-12120)Victor Stinner2019-03-011-1/+13
| | | | | | | | | | | | | * Move fields from _PyMain to _PyCoreConfig: * skip_first_line * run_command * run_module * run_filename * Replace _PyMain.stdin_is_interactive with a new stdin_is_interactive(config) function * Rename _PyMain to _PyArgv. Add "const _PyArgv *args" field to _PyCmdline.
* bpo-36142: Rework error reporting in pymain_main() (GH-12113)Victor Stinner2019-03-012-5/+8
| | | | | | | | | | | Add a new _Py_INIT_EXIT() macro to be able to exit Python with an exitcode using _PyInitError API. Rewrite function calls by pymain_main() to use _PyInitError. Changes: * Remove _PyMain.err and _PyMain.status field * Add _Py_INIT_EXIT() macro and _PyInitError.exitcode field. * Rename _Py_FatalInitError() to _Py_ExitInitError().
* bpo-36142: Exclude coreconfig.h from Py_LIMITED_API (GH-12111)Victor Stinner2019-03-015-27/+41
| | | | | | | | | The whole coreconfig.h header is now excluded from Py_LIMITED_API. Move functions definitions into a new internal pycore_coreconfig.h header. * Move Include/coreconfig.h to Include/cpython/coreconfig.h * coreconfig.h header is now excluded from Py_LIMITED_API * Move functions to pycore_coreconfig.h
* bpo-31904: Add cross-build support for VxWorks RTOS (GH-11968)pxinwr2019-02-271-0/+4
|
* bpo-36030: Remove _PyStack_AsTuple() and _PyStack_AsTupleSlice() (GH-12032)Sergey Fedoseev2019-02-251-10/+0
|
* Post v3.8.0a2Łukasz Langa2019-02-251-1/+1
|
* Merge tag 'v3.8.0a2'Łukasz Langa2019-02-251-2/+2
|\ | | | | | | Python 3.8.0a2
| * v3.8.0a2v3.8.0a2Łukasz Langa2019-02-251-2/+2
| |
* | bpo-36030: Add _PyTuple_FromArray() function (GH-11954)Sergey Fedoseev2019-02-251-0/+1
| |
* | bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)Serhiy Storchaka2019-02-251-0/+1
| |
* | bpo-36048: Use __index__() instead of __int__() for implicit conversion if ↵Serhiy Storchaka2019-02-251-1/+11
|/ | | | | | available. (GH-11952) Deprecate using the __int__() method in implicit conversions of Python numbers to C integers.
* bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-02-243-6/+21
| | | | | | | (GH-11617) This involves moving the global "pending calls" state to PyInterpreterState. https://bugs.python.org/issue33608
* bpo-35724: Explicitly require the main interpreter for signal-handling. ↵Eric Snow2019-02-231-0/+1
| | | | | | | (GH-11530) Ensure that the main interpreter is active (in the main thread) for signal-handling operations. This is increasingly relevant as people use subinterpreters more. https://bugs.python.org/issue35724