summaryrefslogtreecommitdiffstats
path: root/PC
Commit message (Collapse)AuthorAgeFilesLines
* bpo-34770: Fix a possible null pointer dereference in pyshellext.cpp (GH-9497)Zackery Spytz2018-09-251-0/+5
| | | | | | | | The GlobalLock() call in UpdateDropDescription() was not checked for failure. https://bugs.python.org/issue34770
* Simplify PyInit_timezone. (GH-9467)Benjamin Peterson2018-09-211-0/+4
| | | | | | | | Reduce the knotty preprocessor conditional logic, dedent unnecessarily nested code, and handle errors properly. The first edition of this change (afde1c1a05cc8a1e8adf6403c451f6708509a605) failed (bpo-34715) because FreeBSD doesn't define the timezone globals. That's why we're now checking for HAVE_DECL_TZNAME.
* bpo-25711: Rewrite zipimport in pure Python. (GH-6809)Serhiy Storchaka2018-09-181-2/+0
|
* bpo-23855: Add missing NULL checks for malloc() in _msi.c (GH-9038)Zackery Spytz2018-09-071-0/+7
|
* bpo-34565: Change a PC/launcher.c comment to accurately describe valid major ↵Brendan Gerrity2018-09-041-2/+2
| | | | versions. (GH-9037)
* bpo-34062: Add missing launcher argument and make behavior consistent ↵Brendan Gerrity2018-08-311-8/+11
| | | | | | between short and long arguments (GH-8827) Added previously missing "--list" argument. Made "--list" and "--list-paths" behavior consistent with the corresponding "-0" and "-0p" arguments.
* bpo-34217: Use lowercase header for Windows (GH-8453)erikjanss2018-07-251-1/+1
|
* bpo-34170: Add _PyCoreConfig.isolated (GH-8417)Victor Stinner2018-07-241-2/+2
| | | | | | | | | | | | | | | * _PyCoreConfig: add isolated and site_import attributes * Replace Py_IgnoreEnvironment with config->ignore_environment when reading the current configuration * _PyCoreConfig_Read() now sets ignore_environment, utf8_mode, isolated and site_import from Py_IgnoreEnvironment, Py_UTF8Mode, Py_IsolatedFlag and Py_NoSiteFlag * _Py_InitializeCore() now sets Py_xxx flags from the configuration * pymain_read_conf() now uses _PyCoreConfig_Copy() to save/restore the configuration. * Rename _disable_importlib of _PyCoreConfig to _install_importlib * _PyCoreConfig_SetGlobalConfig() now also set Py_HashRandomizationFlag * Replace !Py_NoSiteFlag with core_config->site_import
* bpo-34170: _PyCoreConfig_Read() leaves Py_IsolatedFlag unchanged (GH-8361)Victor Stinner2018-07-211-11/+7
| | | | | | | | | | * _PyCoreConfig_Read() no longer directly modifies Py_IsolatedFlag and Py_NoSiteFlag global configuration flags. The function now requires two pointers to integer, so these flags can be set later, to avoid side effets in _PyCoreConfig_Read(). * pathconfig_global_init() now leaves Py_IsolatedFlag and Py_NoSiteFlag unchanged. * Fix pathconfig_global_init(): avoid computing the path configuration twice, use _PyCoreConfig_SetPathConfig().
* bpo-34170: Rework _PyCoreConfig_Read() to avoid side effect (GH-8353)Victor Stinner2018-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Rework _PyCoreConfig_Read() function which *reads* core configuration to not *modify* the path configuration. A new _PyCoreConfig_SetPathConfig() function now recreates the path configuration from the core configuration. This function is now called very late in _Py_InitializeCore(), just before calling initimport(). Changes: * Add _PyCoreConfig.dll_path * Py_SetPath() now fails with a fatal python error on memory allocation failure. * Rename _PyPathConfig_Calculate() to _PyPathConfig_Calculate_impl() * Replace _PyPathConfig_Init() with _PyPathConfig_Calculate(): the function now requires a _PyPathConfig * Add _PyPathConfig_SetGlobal() to set the _Py_path_config global variable. * Add _PyCoreConfig_InitPathConfig(): compute the path configuration * Add _PyCoreConfig_SetPathConfig(): set path configuration from core configuration * Rename wstrlist_append() to _Py_wstrlist_append() * _Py_wstrlist_append() now handles integer overflow.
* Add missing va_end() calls in PC/launcher.c (GH-7690)Zackery Spytz2018-06-151-0/+2
|
* bpo-33738: Fix macros which contradict PEP 384 (GH-7477)Christian Tismer2018-06-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During development of the limited API support for PySide, we saw an error in a macro that accessed a type field. This patch fixes the 7 errors in the Python headers. Macros which were not written as capitals were implemented as function. To do the necessary analysis again, a script was included that parses all headers and looks for "->tp_" in serctions which can be reached with active limited API. It is easily possible to call this script as a test. Error listing: ../../Include/objimpl.h:243 #define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \ (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) Action: commented only ../../Include/objimpl.h:362 #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0) Action: commented only ../../Include/objimpl.h:364 #define PyObject_GET_WEAKREFS_LISTPTR(o) \ ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset)) Action: commented only ../../Include/pyerrors.h:143 #define PyExceptionClass_Name(x) \ ((char *)(((PyTypeObject*)(x))->tp_name)) Action: implemented function ../../Include/abstract.h:593 #define PyIter_Check(obj) \ ((obj)->ob_type->tp_iternext != NULL && \ (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) Action: implemented function ../../Include/abstract.h:713 #define PyIndex_Check(obj) \ ((obj)->ob_type->tp_as_number != NULL && \ (obj)->ob_type->tp_as_number->nb_index != NULL) Action: implemented function ../../Include/abstract.h:924 #define PySequence_ITEM(o, i)\ ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) ) Action: commented only
* Add missed details of the C API introduced in 3.7. (GH-7047)Serhiy Storchaka2018-05-221-0/+2
| | | | | | * Set the limited API version for PyImport_GetModule and PyOS_*Fork functions. * Add PyImport_GetModule and Py_UTF8Mode in PC/python3.def. * Add several functions in Doc/data/refcounts.dat.
* bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵Siddhesh Poyarekar2018-04-291-3/+2
| | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
* bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter ↵Serhiy Storchaka2018-02-221-0/+1
| | | | | | | | | to compiler. (GH-5006) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-32457: Improves handling of denormalized executable path when launching ↵Steve Dower2018-02-221-54/+42
| | | | Python (GH-5756)
* bpo-31333: Re-implement ABCMeta in C (#5273)Ivan Levkivskyi2018-02-181-0/+2
| | | | This adds C versions of methods used by ABCMeta that improve performance of various ABC operations.
* bpo-32604: Make _xxsubinterpreters build on Windows (GH-5516)Zachary Ware2018-02-111-0/+3
| | | | | This is not the ideal solution; this means that a test module is now always included in the main python3x.dll. However, we're already including xxsubtype, so why not?
* bpo-32747: Remove trailing spaces in docstrings. (GH-5491)oldk2018-02-021-1/+1
|
* Start of 3.8.0a0Ned Deily2018-01-312-795/+795
|
* rename _imp initialization function to follow conventions (#5432)Benjamin Peterson2018-01-291-2/+2
| | | When the C imp module became _imp in 6f44d66bc491bad5b8d897a68da68e009e27829d, the initialization function should have been renamed from PyInit_imp to PyInit__imp.
* bpo-31399: Let OpenSSL verify hostname and IP address (#3462)Christian Heimes2018-01-271-0/+3
| | | | | | | | | | | | | | | bpo-31399: Let OpenSSL verify hostname and IP The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. * Remove match_hostname calls * Check for libssl with set1_host, libssl must provide X509_VERIFY_PARAM_set1_host() * Add documentation for OpenSSL 1.0.2 requirement * Don't support OpenSSL special mode with a leading dot, e.g. ".example.org" matches "www.example.org". It's not standard conform. * Add hostname_checks_common_name Signed-off-by: Christian Heimes <christian@python.org>
* bpo-32030: Add _PyCoreConfig.module_search_paths (#4954)Victor Stinner2018-01-241-0/+3
| | | | | | | | | | | _PyCoreConfig_Read() is now responsible to compute sys.path. So sys.path is now computed before calling _Py_InitializeCore(). Changes: * Add module_search_path, module_search_paths, executable, prefix, base_prefix, exec_prefix and base_exec_prefix to _PyCoreConfig. * _PyMainInterpreterConfig_Read() now only converts wchar_t** lists into a Python list, it doesn't compute sys.path anymore.
* bpo-32588: Move _findvs into its own module and add missing _queue module to ↵Steve Dower2018-01-182-11/+4
| | | | installer (#5227)
* bpo-32507: Change Windows install to include app-local UCRT (#5119)Steve Dower2018-01-091-77/+0
|
* bpo-32030: Add _Py_FindEnvConfigValue() (#4963)Victor Stinner2017-12-211-53/+3
| | | | | | | | | | | | | | | Add a new _Py_FindEnvConfigValue() function: code shared between Windows and Unix implementations of _PyPathConfig_Calculate() to read the pyenv.cfg file. _Py_FindEnvConfigValue() now uses _Py_DecodeUTF8_surrogateescape() instead of using a Python Unicode string, the Python API must not be used early during Python initialization. Same change in Unix search_for_exec_prefix(): use _Py_DecodeUTF8_surrogateescape(). Cleanup also encode_current_locale(): PyMem_RawFree/PyMem_Free can be called with NULL. Fix also "NUL byte" => "NULL byte" typo.
* bpo-32240: Add the const qualifier to declarations of PyObject* array ↵Serhiy Storchaka2017-12-154-31/+31
| | | | arguments. (#4746)
* bpo-32030: Rewrite _PyMainInterpreterConfig (#4854)Victor Stinner2017-12-141-23/+22
| | | | | | | | | | | | | | | | | | | | _PyMainInterpreterConfig now contains Python objects, whereas _PyCoreConfig contains wchar_t* strings. Core config: * Rename _PyMainInterpreterConfig_ReadEnv() to _PyCoreConfig_ReadEnv() * Move 3 strings from _PyMainInterpreterConfig to _PyCoreConfig: module_search_path_env, home, program_name. * Add _PyCoreConfig_Clear() * _PyPathConfig_Calculate() now takes core config rather than main config * _PyMainInterpreterConfig_Read() now requires also a core config Main config: * Add _PyMainInterpreterConfig.module_search_path: sys.path list * Add _PyMainInterpreterConfig.argv: sys.argv list * _PyMainInterpreterConfig_Read() now computes module_search_path
* bpo-32241: Add the const qualifire to declarations of umodifiable strings. ↵Serhiy Storchaka2017-12-121-11/+11
| | | | (#4748)
* Revert "bpo-32197: Try to fix a compiler error on OS X introduced in ↵Victor Stinner2017-12-041-149/+35
| | | | | | | | | | | | | | | | | | | | | | | bpo-32030. (#4681)" (#4694) * Revert "bpo-32197: Try to fix a compiler error on OS X introduced in bpo-32030. (#4681)" This reverts commit 13badcbc60cdbfae1dba1683fd2fae9d70717143. Re-apply commits: * "bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)" commit af5a895073c24637c094772b27526b94a12ec897. * "bpo-32030: Fix config_get_program_name() on macOS (#4669)" commit e23c06e2b03452c9aaf0dae52296c85e572f9bcd. * "bpo-32030: Add Python/pathconfig.c (#4668)" commit 0ea395ae964c9cd0f499e2ef0d0030c971201220. * "bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)" commit ebac19dad6263141d5db0a2c923efe049dba99d2. * "bpo-32030: Fix Py_GetPath(): init program_name (#4665)" commit 9ac3d8882712c9675c3d2f9f84af6b5729575cde. * Fix compilation error on macOS
* bpo-32197: Try to fix a compiler error on OS X introduced in bpo-32030. (#4681)Serhiy Storchaka2017-12-021-35/+149
| | | | | | | | | | | | | | | | | | | | | | * Revert "bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)" This reverts commit af5a895073c24637c094772b27526b94a12ec897. * Revert "bpo-32030: Fix config_get_program_name() on macOS (#4669)" This reverts commit e23c06e2b03452c9aaf0dae52296c85e572f9bcd. * Revert "bpo-32030: Add Python/pathconfig.c (#4668)" This reverts commit 0ea395ae964c9cd0f499e2ef0d0030c971201220. * Revert "bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)" This reverts commit ebac19dad6263141d5db0a2c923efe049dba99d2. * Revert "bpo-32030: Fix Py_GetPath(): init program_name (#4665)" This reverts commit 9ac3d8882712c9675c3d2f9f84af6b5729575cde.
* bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)Victor Stinner2017-12-021-18/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | _PyPathConfig_Init() now also initialize home and program_name: * Rename existing _PyPathConfig_Init() to _PyPathConfig_Calculate(). Add a new _PyPathConfig_Init() function in pathconfig.c which handles the _Py_path_config variable and call _PyPathConfig_Calculate(). * Add home and program_name fields to _PyPathConfig.home * _PyPathConfig_Init() now initialize home and program_name from main_config * Py_SetProgramName(), Py_SetPythonHome() and Py_GetPythonHome() now calls Py_FatalError() on failure, instead of silently ignoring failures. * config_init_home() now gets directly _Py_path_config.home to only get the value set by Py_SetPythonHome(), or NULL if Py_SetPythonHome() was not called. * config_get_program_name() now gets directly _Py_path_config.program_name to only get the value set by Py_SetProgramName(), or NULL if Py_SetProgramName() was not called. * pymain_init_python() doesn't call Py_SetProgramName() anymore, _PyPathConfig_Init() now always sets the program name * Call _PyMainInterpreterConfig_Read() in pymain_parse_cmdline_envvars_impl() to control the memory allocator * C API documentation: it's no more safe to call Py_GetProgramName() before Py_Initialize().
* bpo-32030: Add Python/pathconfig.c (#4668)Victor Stinner2017-12-011-118/+1
| | | | | | | * Factorize code from PC/getpathp.c and Modules/getpath.c to remove duplicated code * rename pathconfig_clear() to _PyPathConfig_Clear() * Inline _PyPathConfig_Fini() in pymain_impl() and then remove it, since it's a oneliner
* bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)Victor Stinner2017-12-011-6/+13
| | | | | | | | | | | | | | | Changes: * _PyPathConfig_Fini() cannot be called in Py_FinalizeEx(). Py_Initialize() and Py_Finalize() can be called multiple times, but it must not "forget" parameters set by Py_SetProgramName(), Py_SetPath() or Py_SetPythonHome(), whereas _PyPathConfig_Fini() clear all these parameters. * config_get_program_name() and calculate_program_full_path() now also decode paths using Py_DecodeLocale() to use the surrogateescape error handler, rather than decoding using mbstowcs() which is strict. * Change _Py_CheckPython3() prototype: () => (void) * Truncate a few lines which were too long
* bpo-32030: Fix Py_GetPath(): init program_name (#4665)Victor Stinner2017-12-011-27/+38
| | | | | | | | | | | | | | | * _PyMainInterpreterConfig_ReadEnv() now sets program_name from environment variables and pymain_parse_envvars() implements the falls back on argv[0]. * Remove _PyMain.program_name: use the program_name from _PyMainInterpreterConfig * Move the Py_SetProgramName() call back to pymain_init_python(), just before _Py_InitializeCore(). * pathconfig_global_init() now also calls _PyMainInterpreterConfig_Read() to set program_name if it isn't set yet * Cleanup PyCalculatePath: pass main_config to subfunctions to get directly fields from main_config (home, module_search_path_env and program_name)
* bpo-32030: Cleanup "path config" code (#4663)Victor Stinner2017-12-011-61/+54
| | | | | | | | | | * Rename PyPathConfig structure to _PyPathConfig and move it to Include/internal/pystate.h * Rename path_config to _Py_path_config * _PyPathConfig: Rename program_name field to program_full_path * Add assert(str != NULL); to _PyMem_RawWcsdup(), _PyMem_RawStrdup() and _PyMem_Strdup(). * Rename calculate_path() to pathconfig_global_init(). The function now does nothing if it's already initiallized.
* bpo-32030: Add _PyPathConfig_Init() (#4551)Victor Stinner2017-11-251-113/+205
| | | | | | | | | | | | | | * Add _PyPathConfig_Init() and _PyPathConfig_Fini() * Remove _Py_GetPathWithConfig() * _PyPathConfig_Init() returns _PyInitError to allow to handle errors properly * Add pathconfig_clear() * Windows calculate_path_impl(): replace Py_FatalError() with _PyInitError * Py_FinalizeEx() now calls _PyPathConfig_Fini() to release memory * Fix _Py_InitializeMainInterpreter() regression: don't initialize path config if _disable_importlib is false * PyPathConfig now uses dynamically allocated memory
* bpo-32030: Add _PyMainInterpreterConfig.program_name (#4548)Victor Stinner2017-11-241-33/+28
| | | | | | * Py_Main() now calls Py_SetProgramName() earlier to be able to get the program name in _PyMainInterpreterConfig_ReadEnv(). * Rename prog to program_name * Rename progpath to program_name
* bpo-32030: Add _PyMainInterpreterConfig_ReadEnv() (#4542)Victor Stinner2017-11-241-23/+26
| | | | | | | | | | | | | | | | | | Py_GetPath() and Py_Main() now call _PyMainInterpreterConfig_ReadEnv() to share the same code to get environment variables. Changes: * Add _PyMainInterpreterConfig_ReadEnv() * Add _PyMainInterpreterConfig_Clear() * Add _PyMem_RawWcsdup() * _PyMainInterpreterConfig: rename pythonhome to home * Rename _Py_ReadMainInterpreterConfig() to _PyMainInterpreterConfig_Read() * Use _Py_INIT_USER_ERR(), instead of _Py_INIT_ERR(), for decoding errors: the user is able to fix the issue, it's not a bug in Python. Same change was made in _Py_INIT_NO_MEMORY(). * Remove _Py_GetPythonHomeWithConfig()
* bpo-12239: Make GetProperty() return None for VT_EMPTY (GH-4539)Berker Peksag2017-11-241-0/+2
| | | | | | | The previous behavior was to raise an exception NotImplementedError: result of type 0 when the value of the property is VT_EMPTY.
* bpo-12382: Make OpenDatabase() raise better exception messages (GH-4528)Berker Peksag2017-11-241-0/+6
| | | | | | | | | | | Previously, 'msilib.OpenDatabase()' function raised a cryptical exception message when it couldn't open or create an MSI file. For example: Traceback (most recent call last): File "<stdin>", line 1, in <module> _msi.MSIError: unknown error 6e
* bpo-32030: Rewrite calculate_path() (#4521)Victor Stinner2017-11-231-208/+385
| | | | | | | | | | | | | | | | | * calculate_path() rewritten in Modules/getpath.c and PC/getpathp.c * Move global variables into a new PyPathConfig structure. * calculate_path(): * Split the huge calculate_path() function into subfunctions. * Add PyCalculatePath structure to pass data between subfunctions. * Document PyCalculatePath fields. * Move cleanup code into a new calculate_free() subfunction * calculate_init() now handles Py_DecodeLocale() failures properly * calculate_path() is now atomic: only replace PyPathConfig (path_config) at once on success. * _Py_GetPythonHomeWithConfig() now returns an error on failure * Add _Py_INIT_NO_MEMORY() helper: report a memory allocation failure * Coding style fixes (PEP 7)
* bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)Berker Peksag2017-11-231-1/+5
|
* bpo-32030: Add _PyMainInterpreterConfig.pythonhome (#4513)Victor Stinner2017-11-231-3/+3
| | | | | | | | | | | | * Py_Main() now reads the PYTHONHOME environment variable * Add _Py_GetPythonHomeWithConfig() private function * Add _PyWarnings_InitWithConfig() * init_filters() doesn't get the current core configuration from the current interpreter or Python thread anymore. Pass explicitly the configuration to _PyWarnings_InitWithConfig(). * _Py_InitializeCore() now fails on _PyWarnings_InitWithConfig() failure. * Pass configuration as constant
* bpo-32030: Move PYTHONPATH to _PyMainInterpreterConfig (#4511)Victor Stinner2017-11-231-5/+5
| | | | Move _PyCoreConfig.module_search_path_env to _PyMainInterpreterConfig structure.
* bpo-32030: Add _PyCoreConfig.module_search_path_env (#4504)Victor Stinner2017-11-221-8/+19
| | | | | | | | | | | Changes: * Py_Main() initializes _PyCoreConfig.module_search_path_env from the PYTHONPATH environment variable. * PyInterpreterState_New() now initializes core_config and config fields * Compute sys.path a little bit ealier in _Py_InitializeMainInterpreter() and new_interpreter() * Add _Py_GetPathWithConfig() private function.
* Add the const qualifier to "char *" variables that refer to literal strings. ↵Serhiy Storchaka2017-11-111-1/+1
| | | | (#4370)
* bpo-20486: Implement Database.Close() method in msilib (GH-4141)Berker Peksag2017-11-071-8/+13
|
* Fix a memory leak in _msi.c (#4127)Zackery Spytz2017-11-071-0/+1
|
* Fix miscellaneous typos (#4275)luzpaz2017-11-053-6/+6
|