aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python
Commit message (Collapse)AuthorAge
* bpo-36710: Add runtime variable in pystate.c (GH-12956)Victor Stinner2019-04-26
| | | | Add 'gilstate', 'runtime' or 'xidregistry' parameter to many functions on pystate.c to avoid lying on _PyRuntime global.
* bpo-36722: Debug build loads libraries built in release mode (GH-12952)Victor Stinner2019-04-26
| | | | In debug build, import now also looks for C extensions compiled in release mode and for C extensions compiled in the stable ABI.
* bpo-36710: Add runtime variable to Py_InitializeEx() (GH-12939)Victor Stinner2019-04-24
| | | | | | | | Py_InitializeEx() now uses a runtime variable passed to subfunctions, rather than working directly on the global variable _PyRuntime. Add 'runtime' parameter to _PyCoreConfig_Write(), _PySys_Create(), _PySys_InitMain(), _PyGILState_Init(), emit_stderr_warning_for_legacy_locale() and other subfunctions.
* bpo-36710: Add runtime variable to Py_FinalizeEx() (GH-12937)Victor Stinner2019-04-24
| | | | | | * Add a 'runtime' variable to Py_FinalizeEx() rather than working directly on the global variable _PyRuntime * Add a 'runtime' parameter to _PyGC_Fini(), _PyGILState_Fini() and call_ll_exitfuncs()
* bpo-36710: PyOS_AfterFork_Child() pass runtime parameter (GH-12936)Victor Stinner2019-04-24
| | | | | | | | | The PyOS_AfterFork_Child() function now pass a 'runtime' parameter to subfunctions. * Fix _PyRuntimeState_ReInitThreads(): use the correct memory allocator * Add runtime parameter to _PyRuntimeState_ReInitThreads(), _PyGILState_Reinit() and _PyInterpreterState_DeleteExceptMain() * Move _PyGILState_Reinit() to the internal C API.
* bpo-36710: Add runtime parameter to _PyThreadState_Init() (GH-12935)Victor Stinner2019-04-24
| | | | | | * Add 'runtime' parameter to _PyThreadState_Init() * Add 'gilstate' parameter to _PyGILState_NoteThreadState() * Move _PyThreadState_Init() and _PyThreadState_DeleteExcept() to the internal C API.
* use `const` in graminit.c (GH-12713)tyomitch2019-04-23
|
* bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853)Victor Stinner2019-04-17
| | | | | | | | | | | | | | | | | | | | 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-32849: Fix is_valid_fd() on FreeBSD (GH-12852)Victor Stinner2019-04-17
| | | | | | | Fix Python Initialization code on FreeBSD to detect properly when stdin file descriptor (fd 0) is invalid. On FreeBSD, fstat() must be used to check if stdin (fd 0) is valid. dup(0) doesn't fail if stdin is invalid in some cases.
* bpo-36623: Clean parser headers and include files (GH-12253)Pablo Galindo2019-04-13
| | | After the removal of pgen, multiple header and function prototypes that lack implementation or are unused are still lying around.
* bpo-33608: Revert "Factor out a private, per-interpreter ↵Eric Snow2019-04-12
| | | | | _Py_AddPendingCall()." (gh-12806) This reverts commit f13c5c8b9401a9dc19e95d8b420ee100ac022208 (gh-12360).
* bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-04-12
| | | | | (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.
* Fix typos in compile.c comments (GH-12752)Simeon2019-04-09
|
* bpo-34373: Fix time.mktime() on AIX (GH-12726)Victor Stinner2019-04-09
| | | | | | | | | | | | | | | Fix time.mktime() error handling on AIX for year before 1970. Other changes: * mktime(): rename variable 'buf' to 'tm'. * _PyTime_localtime(): * Use "localtime" rather than "ctime" in the error message (specific to AIX). * Always initialize errno to 0 just in case if localtime_r() doesn't set errno on error. * On AIX, avoid abs() which is limited to int type. * EINVAL constant is now always available.
* bpo-36301: Fix _PyPreConfig_Read() compiler warning (GH-12695)Victor Stinner2019-04-05
| | | Initialize init_utf8_mode earlier to fix a compiler warning.
* bpo-36495: Fix two out-of-bounds array reads (GH-12641)Brad Larsen2019-04-01
| | | Research and fix by @bradlarsen.
* bpo-36085: Enable better DLL resolution on Windows (GH-12302)Steve Dower2019-03-29
|
* bpo-36471: Add _Py_RunMain() (GH-12618)Victor Stinner2019-03-29
| | | | | * 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-27
| | | | | | | | | | | | | | | | | | | | | | | | 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-36447, bpo-36447: Fix refleak in _PySys_InitMain() (GH-12586)Pablo Galindo2019-03-27
| | | Fix refleak in sysmodule.c when calling SET_SYS_FROM_STRING_BORROW.
* bpo-36444: Rework _Py_InitializeFromConfig() API (GH-12576)Victor Stinner2019-03-27
|
* bpo-36444: Add _PyCoreConfig._init_main (GH-12572)Victor Stinner2019-03-27
| | | | | | | | * 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-27
|
* bpo-36301: Cleanup preconfig.c and coreconfig.c (GH-12563)Victor Stinner2019-03-26
| | | | | | | | | | | | | | | * _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.
* bpo-36301: Remove _PyCoreConfig.preconfig (GH-12546)Victor Stinner2019-03-26
| | | | | | * 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-26
| | | | | * 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-25
| | | | | | | * 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-36370: Check for PyErr_Occurred() after PyImport_GetModule() (GH-12504)Stefan Krah2019-03-25
|
* bpo-36301: Add _Py_PreInitializeFromConfig() (GH-12536)Victor Stinner2019-03-25
| | | | | | | * 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-25
| | | | | | | | | | | | | | | 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-36381: warn when no PY_SSIZE_T_CLEAN defined (GH-12473)Inada Naoki2019-03-23
| | | We will remove int support from 3.10 or 4.0.
* bpo-36301: Add _PyRuntimeState.preconfig (GH-12506)Victor Stinner2019-03-23
| | | | _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-22
| | | | | 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-20
| | | https://bugs.python.org/issue36374
* bpo-36301: Add _PyPreCmdline internal API (GH-12458)Victor Stinner2019-03-20
| | | | _PyCoreConfig_ReadFromArgv() now reuses the code parsing command line options from preconfig.c.
* bpo-36356: Fix _PyCoreConfig_Read() (GH-12454)Victor Stinner2019-03-20
| | | Don't override parameters which are already set by the user.
* bpo-36301: Add _PyRuntime.pre_initialized (GH-12457)Victor Stinner2019-03-20
| | | | | | | | | * 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-19
| | | | | (GH-12430) https://bugs.python.org/issue36362
* bpo-35388: Fix _PyRuntime_Finalize() (GH-12443)Victor Stinner2019-03-20
| | | | | 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-19
| | | | | * _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-19
| | | | | | | | 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-19
| | | _PyEval_FiniThreads() now free the pending lock.
* bpo-36333: Fix leak _PyRuntimeState_Fini (GH-12400)Stéphane Wirtel2019-03-19
|
* bpo-36356: Fix memory leak in _PyPreConfig_Read() (GH-12425)btharper2019-03-19
| | | _PyPreConfig_Read() now free 'old_old' at exit.
* bpo-36352: Avoid hardcoded MAXPATHLEN size in getpath.c (GH-12423)Victor Stinner2019-03-19
| | | | * 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-19
| | | | | | | | 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-18
| | | | | | | | | | 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-18
| | | | | | | 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-18
|
* bpo-36332: Allow compile() to handle AST objects with assignment expressions ↵Pablo Galindo2019-03-18
| | | | | | (GH-12398)