summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-32493: Not only AIX, but FreeBSD has uuid_create support (#5089)David Carlier2018-01-091-4/+1
| | | Allow building the _uuid extension module on FreeBSD and OpenBSD.
* bpo-32282: Remove unnecessary check for `VersionHelpers.h` in ↵Max Bélanger2018-01-071-10/+0
| | | | `socketmodule.c` on Windows
* bpo-31993: Do not allocate large temporary buffers in pickle dump. (#4353)Olivier Grisel2018-01-061-24/+114
| | | | | | | | | | | | | | | | | The picklers do no longer allocate temporary memory when dumping large bytes and str objects into a file object. Instead the data is directly streamed into the underlying file object. Previously the C implementation would buffer all content and issue a single call to file.write() at the end of the dump. With protocol 4 this behavior has changed to issue one call to file.write() per frame. The Python pickler with protocol 4 now dumps each frame content as a memoryview to an IOBytes instance that is never reused and the memoryview is no longer released after the call to write. This makes it possible for the file object to delay access to the memoryview of previous frames without forcing any additional memory copy as was already possible with the C pickler.
* bpo-29137: Remove fpectl module (#4789)Nathaniel J. Smith2018-01-063-468/+0
| | | | | This module has never been enabled by default, never worked correctly on x86-64, and caused ABI problems that caused C extension compatibility. See bpo-29137 for details/discussion.
* bpo-32390: Fix compilation failure on AIX after f_fsid was added to ↵Michael Felt2018-01-051-0/+6
| | | | os.statvfs() (#4972)
* bpo-32226: Make __class_getitem__ an automatic class method. (#5098)Serhiy Storchaka2018-01-041-6/+2
|
* bpo-32308: Replace empty matches adjacent to a previous non-empty match in ↵Serhiy Storchaka2018-01-041-2/+2
| | | | re.sub(). (#4846)
* closes bpo-32460: ensure all non-static globals have initializers (#5061)Benjamin Peterson2017-12-316-48/+47
|
* bpo-32399: Starting with AIX6.1 there is support in libc.a for uuid ↵Michael Felt2017-12-301-6/+17
| | | | | | | | | | | | (RFC4122) (#4974) Starting with AIX6.1 there is support in libc.a for uuid (RFC4122) This patch provides the changes needed for this integration with the OS. On AIX the base function is uuid_create() rather than uuid_generate_time() The AIX uuid_t typedef is more aligned to the UUID field based definition while the Linux typedef that is more aligned with UUID bytes (or perhaps UUID bytes_le) definitions.
* Fix typo (#5049)Andrew Svetlov2017-12-301-1/+1
|
* return the new file descriptor from os.dup2 (closes bpo-32441) (#5041)Benjamin Peterson2017-12-292-19/+35
|
* bpo-31721: Allow Future._log_traceback to only be set to False (#5009)Yury Selivanov2017-12-251-0/+5
|
* bpo-32422: Reduce lru_cache memory usage (GH-5008)INADA Naoki2017-12-251-26/+6
|
* bpo-32363: Disable Task.set_exception() and Task.set_result() (#4923)Yury Selivanov2017-12-252-11/+60
|
* bpo-32402: io: Add missing NULL check. (GH-4971)INADA Naoki2017-12-241-0/+6
| | | | | _PyUnicode_FromId() may return NULL. Reported by coverity scan: CID 1426868, 1426867.
* bpo-32415: Fix "error is already set" (#4999)Yury Selivanov2017-12-231-0/+1
|
* bpo-32357: Use PySet_GET_SIZE macro in _is_coroutine() from _asynciomodule.c ↵Andrew Svetlov2017-12-231-1/+1
| | | | (#4990)
* bpo-32415: Add asyncio.Task.get_loop() and Future.get_loop() (#4992)Yury Selivanov2017-12-232-46/+100
|
* bpo-32030: Add _Py_FindEnvConfigValue() (#4963)Victor Stinner2017-12-211-72/+9
| | | | | | | | | | | | | | | 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-32030: Add _Py_EncodeLocaleRaw() (#4961)Victor Stinner2017-12-212-4/+4
| | | | | | | | | | | | Replace Py_EncodeLocale() with _Py_EncodeLocaleRaw() in: * _Py_wfopen() * _Py_wreadlink() * _Py_wrealpath() * _Py_wstat() * pymain_open_filename() These functions are called early during Python intialization, only the RAW memory allocator must be used.
* bpo-15873: Implement [date][time].fromisoformat (#4699)Paul Ganssle2017-12-211-0/+353
| | | Closes bpo-15873.
* bpo-15216: io: TextIOWrapper.reconfigure() accepts encoding, errors and ↵INADA Naoki2017-12-212-150/+329
| | | | newline (GH-2343)
* bpo-32030: Fix usage of memory allocators (#4953)Victor Stinner2017-12-201-7/+19
| | | | | | | | | * _Py_InitializeCore() doesn't call _PyMem_SetupAllocators() anymore if the PYTHONMALLOC environment variable is not set. * pymain_cmdline() now sets the allocator to the default, instead of setting the allocator in subfunctions. * Py_SetStandardStreamEncoding() now calls _PyMem_SetDefaultAllocator() to get a known allocator, to be able to release the memory with the same allocator.
* correct the typos (#4950)Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)2017-12-201-2/+2
|
* bpo-32030: Complete _PyCoreConfig_Read() (#4946)Victor Stinner2017-12-201-325/+366
| | | | | | | | | | * Add _PyCoreConfig.install_signal_handlers * Remove _PyMain.config: _PyMainInterpreterConfig usage is now restricted to pymain_init_python_main(). * Rename _PyMain.core_config to _PyMain.config * _PyMainInterpreterConfig_Read() now creates the xoptions dictionary from the core config * Fix _PyMainInterpreterConfig_Read(): don't replace xoptions and argv if they are already set.
* bpo-32030: Add _PyCoreConfig.warnoptions (#4936)Victor Stinner2017-12-201-421/+446
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge _PyCoreConfig_ReadEnv() into _PyCoreConfig_Read(), and _Py_CommandLineDetails usage is now restricted to pymain_cmdline(). Changes: * _PyCoreConfig: Add nxoption, xoptions, nwarnoption and warnoptions * Add _PyCoreConfig.program: argv[0] or "" * Move filename, command, module and xoptions from _Py_CommandLineDetails to _PyMain. xoptions _Py_OptList becomes (int, wchar_t**) list. * Add pymain_cmdline() function * Rename copy_argv() to copy_wstrlist(). Rename clear_argv() to clear_wstrlist(). Remove _Py_OptList structure: use (int, wchar_t**) list instead. * Rename pymain_set_flag_from_env() to pymain_get_env_flag() * Rename pymain_set_flags_from_env() to pymain_get_env_flags() * _PyMainInterpreterConfig_Read() now creates the warnoptions from _PyCoreConfig.warnoptions * Inline pymain_add_warning_dev_mode() and pymain_add_warning_bytes_flag() into config_init_warnoptions() * Inline pymain_get_program_name() into _PyCoreConfig_Read() * _Py_CommandLineDetails: Replace warning_options with nwarnoption and warnoptions. Replace env_warning_options with nenv_warnoption and env_warnoptions. * pymain_warnings_envvar() now has a single implementation for Windows and Unix: use config_get_env_var_dup() to also get the variable as wchar_t* on Unix.
* bpo-31901: atexit callbacks should be run at subinterpreter shutdown (#4611)Marcel Plch2017-12-201-32/+40
| | | | Change atexit behavior and PEP-489 multiphase init support.
* bpo-32030: Cleanup pymain_main() (#4935)Victor Stinner2017-12-201-71/+93
| | | | | | | * Reorganize pymain_main() to make the code more flat * Clear configurations before pymain_update_sys_path() * Mark Py_FatalError() and _Py_FatalInitError() with _Py_NO_RETURN * Replace _PyMain.run_code variable with a new RUN_CODE() macro * Move _PyMain.cf into a local variable in pymain_run_python()
* bpo-32030: Add _PyCoreConfig.argv (#4934)Victor Stinner2017-12-191-149/+221
| | | | | | | * Add argc and argv to _PyCoreConfig * _PyMainInterpreterConfig_Read() now builds its argv from _PyCoreConfig.arg * Move _PyMain.env_warning_options into _Py_CommandLineDetails * Reorder pymain_free()
* Fix GCC warning in _asynciomodule.c (#4928)Zackery Spytz2017-12-191-1/+1
|
* bpo-26439 Fix ctypes.util.find_library failure on AIX (#4507)Michael Felt2017-12-191-0/+3
| | | | | Implement find_library() support in ctypes/util for AIX. Add some AIX specific tests.
* bpo-32357: Optimize asyncio.iscoroutine() for non-native coroutines (#4915)Yury Selivanov2017-12-191-28/+85
|
* bpo-32030: Fix compiler warnings (#4921)Victor Stinner2017-12-191-22/+3
| | | | | | | | | | | Fix compiler warnings in Py_FinalizeEx(): only define variables if they are needed, add #ifdef. Other cleanup changes: * _PyWarnings_InitWithConfig() is no more needed: call _PyWarnings_Init() instead. * Inline pymain_init_main_interpreter() in its caller. This subfunction is no more justifed.
* bpo-32331: Fix socket.type when SOCK_NONBLOCK is available (#4877)Yury Selivanov2017-12-191-6/+15
|
* bpo-32030: Fix compilation on FreeBSD, #include <fenv.h> (#4919)Victor Stinner2017-12-181-10/+14
| | | | | * main.c: add missing #include <fenv.h> on FreeBSD * indent also other #ifdef in main.c * cleanup Programs/python.c
* bpo-19764: Implemented support for subprocess.Popen(close_fds=True) on ↵Segev Finer2017-12-182-24/+260
| | | | | | | | | | | | | | | | | Windows (#1218) Even though Python marks any handles it opens as non-inheritable there is still a race when using `subprocess.Popen` since creating a process with redirected stdio requires temporarily creating inheritable handles. By implementing support for `subprocess.Popen(close_fds=True)` we fix this race. In order to implement this we use PROC_THREAD_ATTRIBUTE_HANDLE_LIST which is available since Windows Vista. Which allows to pass an explicit list of handles to inherit when creating a process. This commit also adds `STARTUPINFO.lpAttributeList["handle_list"]` which can be used to control PROC_THREAD_ATTRIBUTE_HANDLE_LIST directly.
* bpo-30050: Allow disabling full buffer warnings in signal.set_wakeup_fd (#4792)Nathaniel J. Smith2017-12-181-53/+51
|
* bpo-32348: Optimize asyncio.Future schedule/add/remove callback. (#4907)Yury Selivanov2017-12-181-75/+322
|
* bpo-32250: Implement asyncio.current_task() and asyncio.all_tasks() (#4799)Andrew Svetlov2017-12-162-111/+399
|
* Add tests for using PEP560 with classes implemented in C. (#4883)Serhiy Storchaka2017-12-161-0/+85
| | | Based on tests from #4878
* bpo-29240, bpo-32030: Py_Main() re-reads config if encoding changes (#4899)Victor Stinner2017-12-162-54/+248
| | | | | | | | | | | | | | | | | | bpo-29240, bpo-32030: If the encoding change (C locale coerced or UTF-8 Mode changed), Py_Main() now reads again the configuration with the new encoding. Changes: * Add _Py_UnixMain() called by main(). * Rename pymain_free_pymain() to pymain_clear_pymain(), it can now be called multipled times. * Rename pymain_parse_cmdline_envvars() to pymain_read_conf(). * Py_Main() now clears orig_argc and orig_argv at exit. * Remove argv_copy2, Py_Main() doesn't modify argv anymore. There is no need anymore to get two copies of the wchar_t** argv. * _PyCoreConfig: add coerce_c_locale and coerce_c_locale_warn. * Py_UTF8Mode is now initialized to -1. * Locale coercion (PEP 538) now respects -I and -E options.
* bpo-32240: Add the const qualifier to declarations of PyObject* array ↵Serhiy Storchaka2017-12-1554-466/+466
| | | | arguments. (#4746)
* move pygetopt.h to internal (closes bpo-32264) (#4830)Benjamin Peterson2017-12-151-2/+1
|
* bpo-32311: Implement asyncio.create_task() shortcut (#4848)Andrew Svetlov2017-12-151-1/+28
| | | | | * Implement functionality * Add documentation
* bpo-32030: Add _PyMainInterpreterConfig.executable (#4876)Victor Stinner2017-12-151-19/+50
| | | | | | | | | | | | * Add new fields to _PyMainInterpreterConfig: * executable * prefix * base_prefix * exec_prefix * base_exec_prefix * _PySys_EndInit() now sets sys attributes from _PyMainInterpreterConfig
* bpo-32030: Add _PyCoreConfig_Copy() (#4874)Victor Stinner2017-12-151-0/+148
| | | | | | | | | | Each interpreter now has its core_config and main_config copy: * Add _PyCoreConfig_Copy() and _PyMainInterpreterConfig_Copy() * Move _PyCoreConfig_Read(), _PyCoreConfig_Clear() and _PyMainInterpreterConfig_Clear() from Python/pylifecycle.c to Modules/main.c * Fix _Py_InitializeEx_Private(): call _PyCoreConfig_ReadEnv() before _Py_InitializeCore()
* bpo-32329: Fix -R option for hash randomization (#4873)Victor Stinner2017-12-141-7/+28
| | | | | | | | | | | | bpo-32329, bpo-32030: * The -R option now turns on hash randomization when the PYTHONHASHSEED environment variable is set to 0 Previously, the option was ignored. * sys.flags.hash_randomization is now properly set to 0 when hash randomization is turned off by PYTHONHASHSEED=0. * _PyCoreConfig_ReadEnv() now reads the PYTHONHASHSEED environment variable. _Py_HashRandomization_Init() now only apply the configuration, it doesn't read PYTHONHASHSEED anymore.
* bpo-32143: add f_fsid to os.statvfs() (#4571)Giuseppe Scrivano2017-12-141-0/+2
| | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* bpo-32277: Fix exception raised from chmod(..., follow_symlinks=False) (#4797)Anthony Sottile2017-12-141-0/+1
|
* bpo-32030: Add _PyMainInterpreterConfig.warnoptions (#4855)Victor Stinner2017-12-141-40/+84
| | | Add warnoptions and xoptions fields to _PyMainInterpreterConfig.