summaryrefslogtreecommitdiff
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-34170: Fix pymain_run_file() (GH-8660)Victor Stinner2018-08-031-6/+6
| | | | | bpo-34170, bpo-34326: Fix pymain_run_file(): use PyRun_AnyFileExFlags(closeit=1) instead of calling fclose(fp) explicitly to close the input file before running the code.
* bpo-34301: Add _PyInterpreterState_Get() helper function (GH-8592)Victor Stinner2018-08-034-15/+14
| | | | sys_setcheckinterval() now uses a local variable to parse arguments, before writing into interp->check_interval.
* Fix docstring of Profiler class (GH-8651)INADA Naoki2018-08-031-2/+2
|
* bpo-34170: Cleanup pymain_run_filename() (GH-8631)Victor Stinner2018-08-021-85/+71
| | | | | | | * Inline pymain_run_file() and pymain_open_filename() into pymain_run_filename() * Created pymain_run_stdin() which is pymain_run_filename() with filename=NULL * Rename pymain_run_filename() to pymain_run_file()
* bpo-34287: Do not use second argument of METH_NOARGS functions (GH-8582)jdemeyer2018-08-021-21/+21
|
* bpo-31650: Remove _Py_CheckHashBasedPycsMode global config var (GH-8608)Victor Stinner2018-08-011-3/+3
| | | | | | | | bpo-31650, bpo-34170: Replace _Py_CheckHashBasedPycsMode with _PyCoreConfig._check_hash_pycs_mode. Modify PyInit__imp() and zipimport to get the parameter from the current interpreter core configuration. Remove Include/internal/import.h file.
* bpo-34170: Add Python/coreconfig.c for _PyCoreConfig (GH-8607)Victor Stinner2018-08-011-910/+13
| | | | | | | * Add Include/coreconfig.h * Move config_*() and _PyCoreConfig_*() functions from Modules/main.c to a new Python/coreconfig.c file. * Inline _Py_ReadHashSeed() into config_init_hash_seed() * Move global configuration variables to coreconfig.c
* bpo-33499: Fix pymain_init_pycache_prefix() (GH-8596)Victor Stinner2018-08-011-10/+10
| | | | Fix a memory leak in pymain_init_pycache_prefix() when PYTHONPYCACHEPREFIX and -X pycache_prefix are used.
* bpo-34170: _PyCoreConfig_Read() defaults to argc=0 (GH-8595)Victor Stinner2018-08-011-0/+3
| | | Add unit tests for argc and argv of _PyCoreConfig.
* bpo-34170: Rename _PyCoreConfig.unbuffered_stdip (GH-8594)Victor Stinner2018-08-011-11/+16
| | | | * Rename _PyCoreConfig.unbuffered_stdio to buffered_stdio * Rename _PyCoreConfig.debug to parser_debug
* bpo-34170: Py_Main() updates config when setting Py_InspectFlag (GH-8593)Victor Stinner2018-08-011-0/+3
|
* bpo-34170: Add _PyCoreConfig._frozen parameter (GH-8591)Victor Stinner2018-08-012-3/+8
| | | Modify frozenmain.c to use _Py_InitializeFromConfig().
* bpo-33089: Add math.dist() for computing the Euclidean distance between two ↵Raymond Hettinger2018-07-312-1/+120
| | | | points (GH-8561)
* bpo-33871: Fix os.sendfile(), os.writev(), os.readv(), etc. (GH-7931)Serhiy Storchaka2018-07-311-17/+20
| | | | | | | | | | | | * Fix integer overflow in os.readv(), os.writev(), os.preadv() and os.pwritev() and in os.sendfile() with headers or trailers arguments (on BSD-based OSes and MacOS). * Fix sending the part of the file in os.sendfile() on MacOS. Using the trailers argument could cause sending more bytes from the input file than was specified. Thanks Ned Deily for testing on 32-bit MacOS.
* bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346)Serhiy Storchaka2018-07-318-204/+179
| | | | | | | | | | | | | | | | | | | | | | | | * help(hashlib) didn't work because of incorrect module name in blake2b and blake2s classes. * Constructors blake2*(), sha3_*(), shake_*() and keccak_*() incorrectly accepted keyword argument "string" for binary data, but documented as accepting the "data" keyword argument. Now this parameter is positional-only. * Keyword-only parameters in blake2b() and blake2s() were not documented as keyword-only. * Default value for some parameters of blake2b() and blake2s() was None, which is not acceptable value. * The length argument for shake_*.digest() was wrapped out to 32 bits. * The argument for shake_128.digest() and shake_128.hexdigest() was not positional-only as intended. * TypeError messages for incorrect arguments in all constructors sha3_*(), shake_*() and keccak_*() incorrectly referred to sha3_224. Also made the following enhancements: * More accurately specified input and result types for strings, bytes and bytes-like objects. * Unified positional parameter names for update() and constructors. * Improved formatting.
* Remove creation of a list for row_cast_map in pysqlite_cursor_init() (GH-8494)Sergey Fedoseev2018-07-311-5/+2
| | | | | This list is never used: if detect_types is on, this list will be replaced with another one before row_cast_map is used, if detect_types is off, row_cast_map is not used at all.
* bpo-34231: PYTHONBREAKPOINT is not documented on python --help (GH-8475)Stéphane Wirtel2018-07-291-0/+2
|
* bpo-33089: Multidimensional math.hypot() (GH-8474)Raymond Hettinger2018-07-282-68/+64
|
* Remove some unused code in _pysqlite_query_execute() (GH-8495)Sergey Fedoseev2018-07-271-6/+0
| | | Unused since commit ab994ed8b97e1b0dac151ec827c857f5e7277565.
* bpo-34170: Cleanup pymain_read_conf() (GH-8476)Victor Stinner2018-07-261-71/+63
| | | | | | | | | | * Config: Rename ignore_environment field to use_environment. * _PyCoreConfig_Read(): if isolated is set, use_environment and site_import are now always set to 0. * Inline pymain_free_raw() into pymain_free() * Move config_init_warnoptions() call into pymain_read_conf_impl() * _PyCoreConfig_Read(): don't replace values if they are already set: faulthandler, pycache_prefix, home.
* bpo-34201: Make ndarray.readonly a bool and use stricter tests in ↵Serhiy Storchaka2018-07-261-1/+1
| | | | test_buffer. (GH-8414)
* bpo-20260: Implement non-bitwise unsigned int converters for Argument ↵Serhiy Storchaka2018-07-266-95/+47
| | | | Clinic. (GH-8434)
* bpo-34197: Make _csv.Dialect attributes booleans. (GH-8440)Serhiy Storchaka2018-07-261-15/+16
| | | | Attributes skipinitialspace, doublequote and strict are now booleans instead of integers 0 or 1.
* bpo-34170: Enhance _PyCoreConfig_Read() (GH-8468)Victor Stinner2018-07-261-66/+78
| | | | | | | | | | | | * Inline cmdline_get_env_flags() into config_read_env_vars(): _PyCoreConfig_Read() now reads much more environment variables like PYTHONVERBOSE. * Allow to override faulthandler and allocator even if dev_mode=1. PYTHONMALLOC is now the priority over PYTHONDEVMODE. * Fix _PyCoreConfig_Copy(): copy also install_signal_handlers, coerce_c_locale and coerce_c_locale_warn * _PyCoreConfig.install_signal_handlers default is now 1: install signals by default * Fix also a compiler warning: don't define _PyPathConfig type twice.
* bpo-34228: Allow PYTHONTRACEMALLOC=0 (GH-8467)Victor Stinner2018-07-251-7/+16
| | | | | PYTHONTRACEMALLOC=0 environment variable and -X tracemalloc=0 command line option are now allowed to disable explicitly tracemalloc at startup.
* bpo-29097: Forego fold detection on windows for low timestamp values (GH-2385)Ammar Askar2018-07-251-1/+16
| | | On Windows, passing a negative value to local results in an OSError because localtime_s on Windows does not support negative timestamps. Unfortunately this means that fold detection for timestamps between 0 and max_fold_seconds will result in this OSError since we subtract max_fold_seconds from the timestamp to detect a fold. However, since we know there haven't been any folds in the interval [0, max_fold_seconds) in any timezone, we can hackily just forego fold detection for this time range on Windows.
* bpo-34218: Fix a leak in _elementtree.c introduced in GH-6769. (GH-8460)Serhiy Storchaka2018-07-251-0/+1
|
* bpo-34170: Cleanup pymain_run_python() (GH-8455)Victor Stinner2018-07-251-107/+67
| | | | * Move _PyMain.main_importer_path inside pymain_run_python * If main_importer_path is non-NULL, update sys.path[0] earlier
* bpo-34170: Add _Py_InitializeFromConfig() (GH-8454)Victor Stinner2018-07-251-121/+117
| | | | | | | | | | | | | | * If _Py_InitializeCore() is called twice, the second call now copies and apply (partially) the new configuration. * Rename _Py_CommandLineDetails to _PyCmdline * Move more code into pymain_init(). The core configuration created by Py_Main() is new destroyed before running Python to reduce the memory footprint. * _Py_InitializeCore() now returns the created interpreter. _Py_InitializeMainInterpreter() now expects an interpreter. * Remove _Py_InitializeEx_Private(): _freeze_importlib now uses _Py_InitializeFromConfig() * _PyCoreConfig_InitPathConfig() now only computes the path configuration if needed.
* bpo-34217: Use lowercase header for Windows (GH-8453)erikjanss2018-07-251-1/+1
|
* bpo-34170: Add _PyCoreConfig.bytes_warning (GH-8447)Victor Stinner2018-07-251-124/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add more fields to _PyCoreConfig: * _check_hash_pycs_mode * bytes_warning * debug * inspect * interactive * legacy_windows_fs_encoding * legacy_windows_stdio * optimization_level * quiet * unbuffered_stdio * user_site_directory * verbose * write_bytecode Changes: * Remove pymain_get_global_config() and pymain_set_global_config() which became useless. These functions have been replaced by _PyCoreConfig_GetGlobalConfig() and _PyCoreConfig_SetGlobalConfig(). * sys.flags.dont_write_bytecode value is now restricted to 1 even if -B option is specified multiple times on the command line. * PyThreadState_Clear() now uses the config from the current interpreter rather than using global Py_VerboseFlag
* bpo-34170: Add _PyCoreConfig.isolated (GH-8417)Victor Stinner2018-07-241-294/+342
| | | | | | | | | | | | | | | * _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-29209: Remove old-deprecated features in ElementTree. (GH-6769)Serhiy Storchaka2018-07-242-112/+21
| | | | | Also make getchildren() and getiterator() emitting a DeprecationWarning instead of PendingDeprecationWarning.
* bpo-34170: _PyCoreConfig_Read() leaves Py_IsolatedFlag unchanged (GH-8361)Victor Stinner2018-07-211-15/+5
| | | | | | | | | | * _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-212-113/+28
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* bpo-34008: Allow to call Py_Main() after Py_Initialize() (GH-8043)Victor Stinner2018-07-201-3/+7
| | | | | Py_Main() can again be called after Py_Initialize(), as in Python 3.6. The new configuration is ignored, except of _PyMainInterpreterConfig.argv which is used to update sys.argv.
* bpo-30237: Output error when ReadConsole is canceled by CancelSynchronousIo. ↵ValeriyaSinevich2018-07-191-1/+5
| | | | (GH-7911)
* bpo-34141: Optimized pickling simple non-recursive values. (GH-8318)Serhiy Storchaka2018-07-181-20/+16
|
* bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an ↵Zackery Spytz2018-07-171-5/+7
| | | | exception set (GH-8282)
* bpo-32430: Rename Modules/Setup.dist to Modules/Setup (GH-8229)Antoine Pitrou2018-07-163-8/+5
| | | | | bpo-32430: Rename Modules/Setup.dist to Modules/Setup Remove the necessity to copy the former manually to the latter when updating the local source tree.
* Factor-out two substantially identical code blocks. (GH-8219)Raymond Hettinger2018-07-101-46/+10
|
* bpo-33597: Reduce PyGC_Head size (GH-7043)INADA Naoki2018-07-101-210/+369
|
* prefix internal sqlite symbols with _pysqlite_ (GH-8215)Benjamin Peterson2018-07-094-19/+19
|
* delete some unused pysqlite forward declarations (GH-8211)Benjamin Peterson2018-07-091-4/+0
|
* bpo-34041: Allow creating deterministic functions in ↵Sergey Fedoseev2018-07-081-4/+28
| | | | Connection.create_function() (GH-8086)
* Make PySimpleQueueType static. (GH-8175)Benjamin Peterson2018-07-071-2/+2
|
* Make various internal _testbuffer symbols static. (GH-8160)Benjamin Peterson2018-07-071-4/+4
|
* Hide some symbols from _xxsubinterpreters. (GH-8151)Benjamin Peterson2018-07-061-2/+2
|
* Make two PyModuleDef_Slot symbols static in _testmultiphase. (GH-8147)Benjamin Peterson2018-07-061-2/+2
|
* Make TaskStepMethWrapper_Type and TaskWakeupMethWrapper_Type static. (GH-8127)Benjamin Peterson2018-07-051-2/+2
|