summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36763: Rework _PyInitError API (GH-13031)Victor Stinner2019-05-012-3/+3
| | | | | | | | | * Remove _PyInitError.user_err field and _Py_INIT_USER_ERR() macro: use _Py_INIT_ERR() instead. _Py_ExitInitError() now longer calls abort() on error: exit with exit code 1 instead. * Add _PyInitError._type private field. * exitcode field type is now unsigned int on Windows. * Rename prefix field to _func. * Rename msg field to err_msg.
* bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970)Victor Stinner2019-04-301-1/+2
| | | Initialize "stack_t current_stack" to zero using memset().
* bpo-36004: Add date.fromisocalendar (GH-11888)Paul Ganssle2019-04-291-0/+67
| | | | This commit implements the first version of date.fromisocalendar, the inverse function for date.isocalendar.
* Revert "bpo-36356: Destroy the GIL at exit (GH-12453)" (GH613006)Victor Stinner2019-04-291-6/+5
| | | This reverts commit b36e5d627d4232a01850707eb78a5067f3fd77f4.
* bpo-36356: Destroy the GIL at exit (GH-12453)Victor Stinner2019-04-291-5/+6
| | | | | | * Add _PyEval_FiniThreads2(). _PyEval_FiniThreads() now only clears the pending lock, whereas _PyEval_FiniThreads2() destroys the GIL. * pymain_free() now calls _PyEval_FiniThreads2(). * Py_FinalizeEx() now calls _PyEval_FiniThreads().
* bpo-2091: Fix typo in exception message (GH-12987)Berker Peksag2019-04-271-1/+1
|
* bpo-36025: Fix PyDate_FromTimestamp API (GH-11922)Paul Ganssle2019-04-272-2/+86
| | | | | | | | | | | | | In the process of converting the date.fromtimestamp function to use argument clinic in GH-8535, the C API for PyDate_FromTimestamp was inadvertently changed to expect a timestamp object rather than an argument tuple. This PR fixes this backwards-incompatible change by adding a new wrapper function for the C API function that unwraps the argument tuple and passes it to the underlying function. This PR also adds tests for both PyDate_FromTimestamp and PyDateTime_FromTimestamp to prevent any further regressions.
* bpo-36356: pymain_exit_error() only call pymain_free() for exit (GH-12968)Victor Stinner2019-04-261-1/+6
| | | Add _Py_INIT_HAS_EXITCODE() macro.
* bpo-36710: Add runtime parameter in gcmodule.c (GH-12958)Victor Stinner2019-04-261-139/+163
| | | | Add 'state' or 'runtime' parameter to functions in gcmodule.c to avoid to rely directly on the global variable _PyRuntime.
* bpo-36710: Add runtime variable to Py_FinalizeEx() (GH-12937)Victor Stinner2019-04-241-2/+3
| | | | | | * 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-241-3/+4
| | | | | | | | | 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-241-1/+1
| | | | | | * Add 'runtime' parameter to _PyThreadState_Init() * Add 'gilstate' parameter to _PyGILState_NoteThreadState() * Move _PyThreadState_Init() and _PyThreadState_DeleteExcept() to the internal C API.
* bpo-18372: Add missing PyObject_GC_Track() calls in the pickle module (GH-8505)Zackery Spytz2019-04-231-0/+3
|
* fix warnings by adding more const (GH-12924)Inada Naoki2019-04-231-2/+1
|
* bpo-36523: Add docstring to io.IOBase.writelines (GH-12683)Marcin Niemira2019-04-222-3/+12
|
* bpo-24011: Use PyModule_Add{Object,IntMacro} in PyInit__signal() (GH-12765)Joannah Nanjekye2019-04-221-7/+5
|
* bpo-36650: Fix handling of empty keyword args in C version of lru_cache. ↵Raymond Hettinger2019-04-201-4/+3
| | | | (GH-12881)
* ctypes: remove use of legacy unicode API (GH-12340)Inada Naoki2019-04-192-15/+19
| | | PyUnicode_AsUnicodeAndSize() -> PyUnicode_AsWideChar()
* bpo-36635: Add _testinternalcapi module (GH-12841)Victor Stinner2019-04-183-8/+46
| | | | | | Add a new _testinternalcapi module to test the internal C API. Move _Py_GetConfigsAsDict() function to the internal C API: _testembed now uses _testinternalcapi to access the function.
* bpo-36071 Add support for Windows ARM32 in ctypes/libffi (GH-12059)Paul Monson2019-04-183-4/+14
|
* bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853)Victor Stinner2019-04-174-16/+27
| | | | | | | | | | | | | | | | | | | | 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-36642: make unicodedata const (GH-12855)Inada Naoki2019-04-163-16/+16
|
* 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-36389: Cleanup gc.set_threshold() (GH-12844)Victor Stinner2019-04-151-2/+2
| | | | Don't assign generations[2].threshold to generations[2].threshold: useless operation.
* bpo-31904: Port the time module on VxWorks (GH-12305)pxinwr2019-04-151-4/+7
| | | time.clock() is not available on VxWorks.
* bpo-33608: Revert "Factor out a private, per-interpreter ↵Eric Snow2019-04-122-10/+4
| | | | | _Py_AddPendingCall()." (gh-12806) This reverts commit f13c5c8b9401a9dc19e95d8b420ee100ac022208 (gh-12360).
* bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-04-122-4/+10
| | | | | (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-18748: io.IOBase destructor now logs close() errors in dev mode (GH-12786)Victor Stinner2019-04-121-3/+15
| | | | | In development mode (-X dev) and in debug build, the io.IOBase destructor now logs close() exceptions. These exceptions are silent by default in release mode.
* bpo-36575: lsprof: Use _PyTime_GetPerfCounter() (GH-8378)Inada Naoki2019-04-111-86/+36
|
* bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770)Victor Stinner2019-04-111-0/+57
| | | | | | | | | 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-31512: Add non-elevated symlink support for Windows (GH-3652)Vidar Tonaas Fauske2019-04-092-71/+44
|
* bpo-34373: Fix time.mktime() on AIX (GH-12726)Victor Stinner2019-04-091-29/+37
| | | | | | | | | | | | | | | 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-36440: include node names in ParserError messages, instead of numeric ↵tyomitch2019-04-031-6/+11
| | | | | IDs (GH-12565) The error messages in the parser module are referring to numeric IDs for the nodes. To improve readability, use the node names when reporting errors.
* bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new(). ↵Zackery Spytz2019-04-021-1/+1
| | | | (GH-12660)
* bpo-20844: open script file with "rb" mode (GH-12616)Inada Naoki2019-04-011-1/+1
|
* bpo-36150: Fix possible assertion failures due to _ctypes.c's ↵Zackery Spytz2019-03-311-4/+5
| | | | PyCData_reduce(). (GH-12106)
* bpo-35947: Fix a compiler warning in _ctypes.c's ↵Zackery Spytz2019-03-311-1/+1
| | | | StructUnionType_paramfunc(). (GH-12629)
* bpo-36085: Enable better DLL resolution on Windows (GH-12302)Steve Dower2019-03-293-14/+251
|
* bpo-35947: Update Windows to the current version of libffi (GH-11797)Paul Monson2019-03-2914-2291/+39
| | | We now use a pre-built libffi binary from our binaries repository, and no longer vendor the full implementation.
* bpo-36471: Add _Py_RunMain() (GH-12618)Victor Stinner2019-03-291-12/+22
| | | | | * Add config_read_cmdline() subfunction. Remove _PyCmdline structure. * _PyCoreConfig_Read() now also parses config->argv command line arguments
* bpo-35194: cjkcodec: check the encoded value is not truncated (GH-10432)Alexey Izbyshev2019-03-291-18/+20
|
* bpo-35941: Fix ssl certificate enumeration for windows (GH-12486)kctherookie2019-03-281-20/+89
| | | Add a function to collect certificates from several certificate stores into one certificate collection store that is then enumerated. This ensures we load as many certificates as we can access.
* bpo-29515: add missing socket.IPPROTO_* constants on Windows (GH-12183)Giampaolo Rodola2019-03-281-1/+46
|
* bpo-36387: Refactor getenvironment() in _winapi.c. (GH-12482)Serhiy Storchaka2019-03-281-46/+34
| | | Make it doing less memory allocations and using the modern C API.
* bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589)Victor Stinner2019-03-271-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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-271-41/+19
|
* bpo-35810: Incref heap-allocated types in PyObject_Init (GH-11661)Eddie Elizondo2019-03-272-4/+5
| | | | | * 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-271-19/+10
| | | | | | | | * 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-271-269/+1
|
* bpo-36301: Cleanup preconfig.c and coreconfig.c (GH-12563)Victor Stinner2019-03-261-11/+7
| | | | | | | | | | | | | | | * _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.