summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36071 Add support for Windows ARM32 in ctypes/libffi (GH-12059)Paul Monson2019-04-182-2/+2
|
* bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853)Victor Stinner2019-04-1718-36/+57
| | | | | | | | | | | | | | | | | | | | Change PyAPI_FUNC(type), PyAPI_DATA(type) and PyMODINIT_FUNC macros of pyport.h when Py_BUILD_CORE_MODULE is defined. The Py_BUILD_CORE_MODULE define must be now be used to build a C extension as a dynamic library accessing Python internals: export the PyInit_xxx() function in DLL exports on Windows. Changes: * Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE now imply Py_BUILD_CORE directy in pyport.h. * ceval.c compilation now fails with an error if Py_BUILD_CORE is not defined, just to ensure that Python is build with the correct defines. * setup.py now compiles _pickle.c with Py_BUILD_CORE_MODULE define. * setup.py compiles _json.c with Py_BUILD_CORE_MODULE define, rather than Py_BUILD_CORE_BUILTIN define * PCbuild/pythoncore.vcxproj: Add Py_BUILD_CORE_BUILTIN define.
* bpo-36641: Add "const" to PyDoc_VAR macro (GH-12854)Inada Naoki2019-04-161-1/+1
| | | It reduces "data" segment in python about 200KB.
* bpo-35134: Add Include/cpython/pymem.h (GH-12840)Victor Stinner2019-04-152-95/+106
| | | | Move unstable CPython API from Include/pymem.h into a new Include/cpython/pymem.h header file.
* bpo-36623: Clean parser headers and include files (GH-12253)Pablo Galindo2019-04-133-68/+0
| | | After the removal of pgen, multiple header and function prototypes that lack implementation or are unused are still lying around.
* bpo-36389: Add _PyObject_CheckConsistency() function (GH-12803)Victor Stinner2019-04-122-0/+19
| | | | | | Add a new _PyObject_CheckConsistency() function which can be used to help debugging. The function is available in release mode. Add a 'check_content' parameter to _PyDict_CheckConsistency().
* bpo-33608: Revert "Factor out a private, per-interpreter ↵Eric Snow2019-04-123-17/+6
| | | | | _Py_AddPendingCall()." (gh-12806) This reverts commit f13c5c8b9401a9dc19e95d8b420ee100ac022208 (gh-12360).
* bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-04-123-6/+17
| | | | | (gh-12360) This is effectively an un-revert of #11617 and #12024 (reverted in #12159). Portions of those were merged in other PRs (with lower risk) and this represents the remainder. Note that I found 3 different bugs in the original PRs and have fixed them here.
* bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)Victor Stinner2019-04-111-10/+9
| | | | | Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD, 0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte patterns than Windows CRT debug malloc() and free().
* bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770)Victor Stinner2019-04-112-2/+25
| | | | | | | | | Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline function. The function is now way more efficient, it became a simple comparison on integers, rather than a short loop. It detects also uninitialized bytes and "forbidden bytes" filled by debug hooks on memory allocators. Add unit tests on _PyObject_IsFreed().
* bpo-36527: silence -Wunused-parameter warnings in object.h (GH-12688)Dmitry Marakasov2019-04-061-0/+3
|
* bpo-36471: Add _Py_RunMain() (GH-12618)Victor Stinner2019-03-291-0/+3
| | | | | * Add config_read_cmdline() subfunction. Remove _PyCmdline structure. * _PyCoreConfig_Read() now also parses config->argv command line arguments
* bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589)Victor Stinner2019-03-271-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | bpo-36443, bpo-36202: Since Python 3.7.0, calling Py_DecodeLocale() before Py_Initialize() produces mojibake if the LC_CTYPE locale is coerced and/or if the UTF-8 Mode is enabled by the user configuration. This change fix the issue by disabling LC_CTYPE coercion and UTF-8 Mode by default. They must now be enabled explicitly (opt-in) using the new _Py_PreInitialize() API with _PyPreConfig. When embedding Python, set coerce_c_locale and utf8_mode attributes of _PyPreConfig to -1 to enable automatically these parameters depending on the LC_CTYPE locale, environment variables and command line arguments Alternative: Setting Py_UTF8Mode to 1 always explicitly enables the UTF-8 Mode. Changes: * _PyPreConfig_INIT now sets coerce_c_locale and utf8_mode to 0 by default. * _Py_InitializeFromArgs() and _Py_InitializeFromWideArgs() can now be called with config=NULL.
* bpo-36444: Rework _Py_InitializeFromConfig() API (GH-12576)Victor Stinner2019-03-274-56/+62
|
* bpo-35810: Incref heap-allocated types in PyObject_Init (GH-11661)Eddie Elizondo2019-03-271-0/+3
| | | | | * Incref heap-allocated types in PyObject_Init * Add documentation and porting notes to What's New
* bpo-36444: Add _PyCoreConfig._init_main (GH-12572)Victor Stinner2019-03-272-5/+7
| | | | | | | | * Add _PyCoreConfig._init_main: if equals to zero, _Py_InitializeFromConfig() doesn't call _Py_InitializeMainInterpreter(). * Add interp_p parameter to _Py_InitializeFromConfig(). * pymain_init() now calls _Py_InitializeFromConfig(). * Make _Py_InitializeCore() private.
* bpo-36444: Remove _PyMainInterpreterConfig (GH-12571)Victor Stinner2019-03-274-39/+1
|
* bpo-36301: Cleanup preconfig.c and coreconfig.c (GH-12563)Victor Stinner2019-03-262-30/+18
| | | | | | | | | | | | | | | * _PyCoreConfig_Write() now updates _PyRuntime.preconfig * Remove _PyPreCmdline_Copy() * _PyPreCmdline_Read() now accepts _PyPreConfig and _PyCoreConfig optional configurations. * Rename _PyPreConfig_ReadFromArgv() to _PyPreConfig_Read(). Simplify the code. * Calling _PyCoreConfig_Read() no longer adds the warning options twice: don't add a warning option if it's already in the list. * Rename _PyCoreConfig_ReadFromArgv() to _PyCoreConfig_Read(). * Rename config_from_cmdline() to _PyCoreConfig_ReadFromArgv(). * Add more assertions on _PyCoreConfig in _PyCoreConfig_Read(). * Move some functions. * Make some config functions private.
* Post v3.8.0a3Łukasz Langa2019-03-261-1/+1
|
* Merge tag 'v3.8.0a3'Łukasz Langa2019-03-261-2/+2
|\ | | | | | | Python 3.8.0a3
| * v3.8.0a3v3.8.0a3Łukasz Langa2019-03-251-2/+2
| |
* | bpo-36301: Remove _PyCoreConfig.preconfig (GH-12546)Victor Stinner2019-03-264-5/+14
| | | | | | | | | | | | * Replace _PyCoreConfig.preconfig with 3 new fields in _PyCoreConfig: isolated, use_environment, dev_mode. * Add _PyPreCmdline.dev_mode. * Add _Py_PreInitializeFromPreConfigInPlace().
* | bpo-36301: Add _Py_GetEnv() function (GH-12542)Victor Stinner2019-03-251-11/+5
| | | | | | | | | | * Make _PyPreConfig_GetEnv(), _PyCoreConfig_GetEnv() and _PyCoreConfig_GetEnvDup() private * _Py_get_env_flag() first parameter becomes "int use_environment"
* | bpo-36301: Add _Py_GetConfigsAsDict() function (GH-12540)Victor Stinner2019-03-253-7/+7
|/ | | | | | | * Add _Py_GetConfigsAsDict() function to get all configurations as a dict. * dump_config() of _testembed.c now dumps preconfig as a separated key: call _Py_GetConfigsAsDict(). * Make _PyMainInterpreterConfig_AsDict() private.
* bpo-36301: Add _Py_PreInitializeFromConfig() (GH-12536)Victor Stinner2019-03-253-2/+18
| | | | | | | * Initialize _PyPreConfig.dev_mode to -1. * _PyPreConfig_Read(): coreconfig has the priority over preconfig. * _PyCoreConfig_Read() now calls _PyPreCmdline_Read() internally. * config_from_cmdline() now pass _PyPreCmdline to config_read(). * Add _PyPreCmdline_Copy().
* bpo-36301: Cleanup preconfig code (GH-12535)Victor Stinner2019-03-252-9/+13
| | | | | | | | | | | | | | | Prepare code to move some _PyPreConfig parameters into _PyPreCmdline. Changes: * _PyCoreConfig_ReadFromArgv(): remove preconfig parameter, use _PyRuntime.preconfig. * Add _PyPreCmdline_GetPreConfig() (called by _PyPreConfig_Read()). * Rename _PyPreCmdline_Init() to _PyPreCmdline_SetArgv() * Factorize _Py_PreInitializeFromPreConfig() code: add pyinit_preinit(). * _PyPreConfig_Read() now sets coerce_c_locale to 2 if it must be coerced. * Remove _PyCoreConfig_ReadPreConfig(). * _PyCoreConfig_Write() now copies updated preconfig into _PyRuntime.
* bpo-36301: Add _PyRuntimeState.preconfig (GH-12506)Victor Stinner2019-03-231-0/+2
| | | | _PyPreConfig_Write() now writes the applied pre-configuration into _PyRuntimeState.preconfig.
* 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".