summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36301: Add _PyRuntimeState.preconfig (GH-12506)Victor Stinner2019-03-233-0/+34
| | | | _PyPreConfig_Write() now writes the applied pre-configuration into _PyRuntimeState.preconfig.
* bpo-35284: Fix the error handling in the compiler's compiler_call(). (GH-10625)Zackery Spytz2019-03-221-2/+5
| | | | | compiler_call() needs to check if an error occurred during the maybe_optimize_method_call() call.
* bpo-36374: Fix a possible null pointer dereference (GH-12449)Zackery Spytz2019-03-201-1/+1
| | | https://bugs.python.org/issue36374
* bpo-36301: Add _PyPreCmdline internal API (GH-12458)Victor Stinner2019-03-202-47/+75
| | | | _PyCoreConfig_ReadFromArgv() now reuses the code parsing command line options from preconfig.c.
* bpo-36356: Fix _PyCoreConfig_Read() (GH-12454)Victor Stinner2019-03-201-23/+32
| | | Don't override parameters which are already set by the user.
* bpo-36301: Add _PyRuntime.pre_initialized (GH-12457)Victor Stinner2019-03-203-4/+51
| | | | | | | | | * 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-36362: Avoid unused variables when HAVE_DYNAMIC_LOADING is not defined ↵Stéphane Wirtel2019-03-191-2/+3
| | | | | (GH-12430) https://bugs.python.org/issue36362
* bpo-35388: Fix _PyRuntime_Finalize() (GH-12443)Victor Stinner2019-03-191-3/+4
| | | | | Calling _PyRuntime_Initialize() after _PyRuntime_Finalize() now re-initializes _PyRuntime structure. Previously, _PyRuntime_Initialize() did nothing in that case.
* bpo-36236: Fix _PyPathConfig_ComputeSysPath0() for empty argv (GH-12441)Victor Stinner2019-03-191-55/+63
| | | | | * _PyPathConfig_ComputeSysPath0() now returns 0 if argv is empty. * Cleanup also _PyPathConfig_ComputeSysPath0() code: move variables definitions closer to where they are used.
* bpo-36236: Handle removed cwd at Python init (GH-12424)Victor Stinner2019-03-192-18/+35
| | | | | | | | 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-36333, bpo-36356: Fix _PyEval_FiniThreads() (GH-12432)Victor Stinner2019-03-191-2/+11
| | | _PyEval_FiniThreads() now free the pending lock.
* bpo-36333: Fix leak _PyRuntimeState_Fini (GH-12400)Stéphane Wirtel2019-03-191-0/+5
|
* bpo-36356: Fix memory leak in _PyPreConfig_Read() (GH-12425)btharper2019-03-191-0/+1
| | | _PyPreConfig_Read() now free 'old_old' at exit.
* bpo-36352: Avoid hardcoded MAXPATHLEN size in getpath.c (GH-12423)Victor Stinner2019-03-192-7/+9
| | | | * Use Py_ARRAY_LENGTH() rather than hardcoded MAXPATHLEN in getpath.c. * Pass string length to functions modifying strings.
* bpo-36301: Error if decoding pybuilddir.txt fails (GH-12422)Victor Stinner2019-03-191-1/+1
| | | | | | | | 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-36301: Fix Py_Main() memory leaks (GH-12420)Victor Stinner2019-03-182-0/+6
| | | | | | | | | | bpo-36301, bpo-36333: * Fix memory allocator used by _PyPathConfig_ClearGlobal(): force the default allocator. * _PyPreConfig_ReadFromArgv(): free init_ctype_locale memory. * pymain_main(): call pymain_free() on init error Co-Authored-By: Stéphane Wirtel <stephane@wirtel.be>
* bpo-36352: Clarify fileutils.h documentation (GH-12406)Victor Stinner2019-03-181-14/+21
| | | | | | | 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.
* bpo-36328: Fix compiler warning in Py_NewInterpreter() (GH-12381)Stéphane Wirtel2019-03-181-1/+1
|
* bpo-36332: Allow compile() to handle AST objects with assignment expressions ↵Pablo Galindo2019-03-181-3/+4
| | | | | | (GH-12398)
* bpo-36127: Fix compiler warning in _PyArg_UnpackKeywords(). (GH-12353)Serhiy Storchaka2019-03-161-1/+1
|
* bpo-36124: Add PyInterpreterState.dict. (gh-12132)Eric Snow2019-03-151-0/+14
|
* bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as ↵Eric Snow2019-03-151-2/+24
| | | | necessary). (gh-12359)
* bpo-33608: Deal with pending calls relative to runtime shutdown. (gh-12246)Eric Snow2019-03-152-22/+67
|
* bpo-33608: Fix PyEval_InitThreads() warning (GH-12346)Victor Stinner2019-03-151-1/+1
| | | | | | | | The function has no return value. Fix the following warning on Windows: python\ceval.c(180): warning C4098: 'PyEval_InitThreads': 'void' function returning a value
* bpo-36301: _PyCoreConfig_Read() ensures that argv is not empty (GH-12347)Victor Stinner2019-03-151-0/+7
| | | If argv is empty, add an empty string.
* bpo-36301: Add _PyWstrList structure (GH-12343)Victor Stinner2019-03-155-283/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-146-81/+471
| | | | (GH-12058)
* bpo-36254: Fix yet one invalid use of %d in format string in C. (GH-12318)Serhiy Storchaka2019-03-141-1/+1
|
* bpo-36282: Improved error message for too much positional arguments. (GH-12310)Serhiy Storchaka2019-03-131-1/+1
|
* bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264)Serhiy Storchaka2019-03-135-9/+9
|
* bpo-36280: Add Constant.kind field (GH-12295)Guido van Rossum2019-03-132-12/+73
| | | | | | | | | | | | | | 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
* bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276)Victor Stinner2019-03-131-54/+25
| | | | | | | | | | | | Fix an unlikely memory leak on conversion from string to float in the function _Py_dg_strtod() used by float(str), complex(str), pickle.load(), marshal.load(), etc. Fix an unlikely memory leak in _Py_dg_strtod() on "undfl:" label: rewrite memory management in this function to always release all memory before exiting the function. Initialize variables to NULL, and set them to NULL after calling Bfree() at the "cont:" label. Note: Bfree(NULL) is well defined: it does nothing.
* Remove d_initial from the parser as it is unused (GH-12212)tyomitch2019-03-091-92/+92
| | | 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-092-40/+38
|
* bpo-33608: Minor cleanup related to pending calls. (gh-12247)Eric Snow2019-03-093-67/+77
|
* Simplify DISPATCH by hoisting eval_breaker ahead of time. (gh-12243)Eric Snow2019-03-091-2/+3
|
* bpo-35843: Implement __getitem__ for _NamespacePath (GH-11690)Anthony Sottile2019-03-081-869/+878
|
* bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086)Guido van Rossum2019-03-077-133/+215
| | | | | | | 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-36142: PYTHONMALLOC overrides PYTHONDEV (GH-12191)Victor Stinner2019-03-061-7/+11
| | | | | | | | bpo-34247, bpo-36142: The PYTHONMALLOC environment variable has the priority over PYTHONDEV env var and "-X dev" command line option. For example, PYTHONMALLOC=malloc PYTHONDEVMODE=1 sets the memory allocators to "malloc" (and not to "debug"). Add an unit test.
* bpo-36142: _PyPreConfig_Read() sets LC_CTYPE (GH-12188)Victor Stinner2019-03-063-46/+78
| | | | | | | * _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-45/+45
| | | | | | | | | | | * _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-052-40/+93
| | | | | | | * _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-1/+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-054-141/+97
| | | | | 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-054-23/+72
| | | | | | * 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-054-341/+417
| | | | | | | | | | | | * 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-055-40/+168
| | | | The new function is now responsible to parse -E and -I command line arguments.
* bpo-36142: Add _PyPreConfig structure (GH-12172)Victor Stinner2019-03-054-34/+151
| | | | | | * 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-044-231/+151
| | | | | | | | | | | | | | | | | | | _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-042-4/+4
| | | | | | | | 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.