summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35059: Cleanup usage of Python macros (GH-10648)Victor Stinner2018-11-224-90/+114
| | | | | | | | | | | | | Don't pass complex expressions but regular variables to Python macros. * _datetimemodule.c: split single large "if" into two "if" in date_new(), time_new() and datetime_new(). * _pickle.c, load_extension(): flatten complex "if" expression into more regular C code. * _ssl.c: addbool() now uses a temporary bool_obj to only evaluate the value once. * weakrefobject.c: replace "Py_INCREF(result = proxy);" with "result = proxy; Py_INCREF(result);"
* bpo-35059: Add _PyObject_CAST() macro (GH-10645)Victor Stinner2018-11-225-23/+29
| | | | Add _PyObject_CAST() and _PyVarObject_CAST() macros to cast argument to PyObject* and PyVarObject* properly.
* bpo-35059: Convert _PyObject_GC_TRACK() to inline function (GH-10643)Victor Stinner2018-11-223-42/+68
| | | | | | | | | | | | | * Add _PyObject_ASSERT_FROM() and _PyObject_ASSERT_FAILED_MSG() macros. * PyObject_GC_Track() now calls _PyObject_ASSERT_FAILED_MSG(), instead of Py_FatalError(), if the object is already tracked, to dump more information on error. * _PyObject_GC_TRACK() no longer checks if the object is already tracked at runtime, use an assertion instead for best performances; PyObject_GC_Track() still checks at runtime. * pycore_object.h now includes pycore_pystate.h. * Convert _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() macros to inline functions.
* bpo-35059: Enhance _PyObject_AssertFailed() (GH-10642)Victor Stinner2018-11-213-14/+20
| | | | | | Enhance _PyObject_AssertFailed() * Exchange 'expr' and 'msg' parameters * 'expr' and 'func' arguments can now be NULL
* bpo-35081: Add Include/internal/pycore_object.h (GH-10640)Victor Stinner2018-11-2134-50/+93
| | | | Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from Include/objimpl.h to Include/internal/pycore_object.h.
* bpo-35189: Fix eintr_tester.py (GH-10637)Victor Stinner2018-11-211-22/+18
| | | | | | | | | | | | | Call setitimer() before each test method, instead of once per test case, to ensure that signals are sent in each test method. Previously, only the first method of a testcase class got signals. Changes: * Replace setUpClass() with setUp() and replace tearDownClass() with tearDown(). * tearDown() now ensures that at least one signal has been sent. * Replace support.run_unittest() with unittest.main() which has a nicer CLI and automatically discover test cases.
* bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023)Zhiming Wang2018-11-213-1/+2
| | | I'll watch for 404 on the old URL and will setup an HTTP redirection if needed.
* bpo-35290: Add debug info to test_c_locale_coercion (GH-10631)Victor Stinner2018-11-211-6/+15
| | | | In verbose mode, test_c_locale_coercion now dumps global variables at startup.
* bpo-35221: Additional hint that the placeholder is to be replaced. (GH-10604)Julien Palard2018-11-211-1/+2
|
* bpo-35081: Move _PyGC_FINALIZED() back to C API (GH-10626)Victor Stinner2018-11-201-3/+3
| | | | | | | | | | | | | | | | Partially revert commit 1a6be91e6fd65ce9cb88cbbbb193db7e92ec6076, move back PyGC API from the internal API to the C API: * _PyGCHead_NEXT(g), _PyGCHead_SET_NEXT(g, p) * _PyGCHead_PREV(g), _PyGCHead_SET_PREV(g, p) * _PyGCHead_FINALIZED(g), _PyGCHead_SET_FINALIZED(g) * _PyGC_FINALIZED(o), _PyGC_SET_FINALIZED(o) * _PyGC_PREV_MASK_FINALIZED * _PyGC_PREV_MASK_COLLECTING * _PyGC_PREV_SHIFT * _PyGC_PREV_MASK _PyObject_GC_TRACK(o) and _PyObject_GC_UNTRACK(o) remain in the internal API.
* bpo-34532: Fixed exit code for py.exe list versions arg (GH-9039)Brendan Gerrity2018-11-202-4/+6
|
* bpo-25750: Fix a compiler warning introduced in GH-9084. (GH-10234)Serhiy Storchaka2018-11-201-5/+5
|
* bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039)Serhiy Storchaka2018-11-202-54/+88
| | | | | | | | Fixes assertion failures in _datetimemodule.c introduced in the previous fix (see bpo-31752). Rather of trying to handle an int subclass as exact int, let it to use overridden special methods, but check the result of divmod().
* bpo-35169: Improve error messages for forbidden assignments. (GH-10342)Serhiy Storchaka2018-11-206-96/+140
|
* bpo-9842: Add references for using "..." as a placeholder to the index. ↵Serhiy Storchaka2018-11-203-0/+7
| | | | (GH-10330)
* bpo-31146: Don't fallback switcher to english on not-yet pusblished ↵Julien Palard2018-11-201-0/+6
| | | | languages. (GH-10558)
* bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606)Victor Stinner2018-11-208-60/+145
| | | | | | | | | | | | | | | | | | | | | locale.localeconv() now sets temporarily the LC_CTYPE locale to the LC_MONETARY locale if the two locales are different and monetary strings are non-ASCII. This temporary change affects other threads. Changes: * locale.localeconv() can now set LC_CTYPE to LC_MONETARY to decode monetary fields. * Add LocaleInfo.grouping_buffer: copy localeconv() grouping string since it can be replaced anytime if a different thread calls localeconv(). * _Py_GetLocaleconvNumeric() now requires a "struct lconv *" structure, so locale.localeconv() now longer calls localeconv() twice. Moreover, the function now requires all arguments to be non-NULL. * Rename STATIC_LOCALE_INFO_INIT to LocaleInfo_STATIC_INIT. * Move _Py_GetLocaleconvNumeric() definition from fileutils.h to pycore_fileutils.h. pycore_fileutils.h now includes locale.h. * The _locale module is now built with Py_BUILD_CORE defined.
* bpo-18859: Document --with-valgrind option in README.valgrind (#10591)Sanyam Khurana2018-11-201-0/+8
|
* Upgrade pip to 18.1 and setuptools to 40.6.2 (#10598)Donald Stufft2018-11-195-2/+3
|
* bpo-35269: Fix a possible segfault involving a newly-created coroutine ↵Zackery Spytz2018-11-182-1/+3
| | | | | | | | | | | (GH-10585) coro->cr_origin wasn't initialized if compute_cr_origin() failed in PyCoro_New(), which would cause a crash during the coroutine's deallocation. https://bugs.python.org/issue35269
* bpo-34725: Adds _Py_SetProgramFullPath so embedders may override ↵Steve Dower2018-11-186-33/+74
| | | | sys.executable (GH-9860)
* bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as ↵Windson yang2018-11-171-1/+2
| | | | | | | | | | | (GH-10580) Source of T_STRING: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/structmember.c#L51 Source of PyUnicode_FromString https://github.com/python/cpython/blob/master/Include/unicodeobject.h#L702 https://bugs.python.org/issue25438
* Add --tempdir option for test run (GH-10322)Steve Dower2018-11-173-11/+9
|
* bpo-35202: Remove more unused imports in idlelib (GH-10573)Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)2018-11-174-4/+3
|
* bpo-28401: prevent Py_DEBUG builds from trying to import limited ABI modules ↵Stefano Rivera2018-11-162-0/+5
| | | | | | | | (GH-1766) [Issue 28401](https://bugs.python.org/issue28401): Don't attempt to import the stable API extensions, they are not supported in PyDEBUG builds (which don't implement that ABI). https://bugs.python.org/issue28401
* Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576)Zackery Spytz2018-11-161-1/+3
| | | | This missed PyErr_NoMemory() could cause a SystemError when calling _symtable.symtable().
* bpo-35202: Remove unused imports in tests. (GH-10561)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-1617-18/+1
|
* bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-162-8/+8
|
* Fix outdated info in datamodel about dicts (GH-9807)wim glenn2018-11-161-2/+2
|
* bpo-33816: Remove outdated metaclass example (GH-7566)Andrés Delfino2018-11-161-34/+2
|
* bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532)Victor Stinner2018-11-163-13/+28
| | | | | | | | | | | * The _PySys_EndInit() function now copies the config->module_search_path list, so config is longer modified when sys.path is updated. * config->warnoptions list and config->xoptions dict are also copied * test_embed: InitConfigTests now also tests main_config['module_search_path'] * Fix _Py_InitializeMainInterpreter(): don't use config->warnoptions but sys.warnoptions to decide if the warnings module should be imported at startup.
* bpo-35213: Where appropriate, use 'macOS' in idlelib. (#10478)Terry Jan Reedy2018-11-156-28/+28
|
* bpo-35202: Remove unused imports in Lib directory (GH-10450)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-155-5/+0
|
* Fix typo in asynchronous generator iterator documentation (GH-10542)Sebastián Ramírez2018-11-151-2/+2
| | | | Remove an unnecessary "that": ... will execute that the body ... -> ... will execute the body ...
* bpo-34784: Implement correct cleanup in PyStructSequence new implementation ↵Pablo Galindo2018-11-151-0/+5
| | | | | | (GH-10536) PyTuple_Pack can fail and return NULL. If this happens, then PyType_FromSpecWithBases will incorrectly create a new type without bases. Also, it will crash on the Py_DECREF that follows. Also free members and type in error conditions.
* Fix a possible reference leak in _socket.getaddrinfo(). (GH-10543)Zackery Spytz2018-11-141-2/+4
| | | "single" needs to be decrefed if PyList_Append() fails.
* bpo-35233: InitConfigTests tests more config vars (GH-10541)Victor Stinner2018-11-146-239/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test_embed.InitConfigTests tests more configuration variables. Changes: * InitConfigTests tests more core configuration variables: * base_exec_prefix * base_prefix * exec_prefix * home * legacy_windows_fs_encoding * legacy_windows_stdio * module_search_path_env * prefix * "_testembed init_from_config" tests more variables: * argv * warnoptions * xoptions * InitConfigTests: add check_global_config(), check_core_config() and check_main_config() subfunctions to cleanup the code. Move also constants at the class level (ex: COPY_MAIN_CONFIG). * Fix _PyCoreConfig_AsDict(): don't set stdio_encoding twice * Use more macros in _PyCoreConfig_AsDict() and _PyMainInterpreterConfig_AsDict() to reduce code duplication. * Other minor cleanups.
* bpo-32613: Update window FAQ (GH-5552)Julien Palard2018-11-143-45/+26
|
* bpo-35230: dict: Remove some macros (GH-10513)INADA Naoki2018-11-142-44/+59
| | | | Remove _Py_REF_DEBUG_COMMA, DK_DEBUG_INCREF, and DK_DEBUG_DECREF. Convert DK_INCREF and DK_DECREF to static inline functions.
* Grammar corrections in abc.rst (GH-10525)Andrés Delfino2018-11-141-3/+3
|
* Link to property built-in in abc.rst (GH-10526)Andrés Delfino2018-11-141-1/+1
|
* Fix doc typo: Window -> Windows (GH-10508)l-n-s2018-11-141-1/+1
|
* bpo-35233: Rewrite test_embed.InitConfigTests (GH-10524)Victor Stinner2018-11-136-179/+241
| | | | | | | | | | | | * Fix _PyCoreConfig_SetGlobalConfig(): set also Py_FrozenFlag * Fix _PyCoreConfig_AsDict(): export also xoptions * Add _Py_GetGlobalVariablesAsDict() and _testcapi.get_global_config() * test.pythoninfo: dump also global configuration variables * _testembed now serializes global, core and main configurations using JSON to reuse _Py_GetGlobalVariablesAsDict(), _PyCoreConfig_AsDict() and _PyMainInterpreterConfig_AsDict(), rather than duplicating code. * test_embed.InitConfigTests now test much more configuration variables
* bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506)Gregory P. Smith2018-11-132-1/+4
| | | | | | Discovered using clang's MemorySanitizer when it ran python3's test_fstring test_misformed_unicode_character_name. An msan build will fail by simply executing: ./python -c 'u"\N"'
* bpo-35233: Fix _PyMainInterpreterConfig_Copy() (GH-10519)Victor Stinner2018-11-136-67/+215
| | | | | | | | * Fix _PyMainInterpreterConfig_Copy(): copy 'install_signal_handlers' attribute * Add _PyMainInterpreterConfig_AsDict() * Add unit tests on the main interpreter configuration to test_embed.InitConfigTests * test.pythoninfo: log also main_config
* bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc (GH-10510)Victor Stinner2018-11-132-0/+10
| | | | | If tracemalloc is not tracing Python memory allocations, _PyMem_DumpTraceback() now suggests to enable tracemalloc to get the traceback where the memory block has been allocated.
* bpo-34784: Fix PyStructSequence_NewType with heap-allocated StructSequence ↵Eddie Elizondo2018-11-135-137/+239
| | | | (GH-9665)
* bpo-35081: Make some _PyGC macros internal (GH-10507)Victor Stinner2018-11-135-38/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | * Move "GC" macros together: * PyObject_IS_GC() * _Py_AS_GC() * _PyObject_GC_IS_TRACKED() * _PyObject_GC_MAY_BE_TRACKED() * Mark other GC macros as internal (#ifdef Py_BUILD_CORE): * _PyGCHead_NEXT(g), _PyGCHead_SET_NEXT(g, p) * _PyGCHead_PREV(g), _PyGCHead_SET_PREV(g, p) * _PyGCHead_FINALIZED(g), _PyGCHead_SET_FINALIZED(g) * _PyGC_FINALIZED(o), _PyGC_SET_FINALIZED(o) * _PyObject_GC_TRACK(o), _PyObject_GC_UNTRACK(o) * _PyGC_PREV_MASK_FINALIZED * _PyGC_PREV_MASK_COLLECTING * _PyGC_PREV_SHIFT * _PyGC_PREV_MASK * Replace _PyGC_generation0 with _PyRuntime.gc.generation0 * _queuemodule.c: replace _PyObject_GC_UNTRACK() with with PyObject_GC_UnTrack() * Document that _PyObject_GC_TRACK() _PyObject_GC_UNTRACK() macros have been removed from the public C API.
* bpo-35081: Remove Py_BUILD_CORE from datetime.h (GH-10416)Paul Ganssle2018-11-132-29/+28
| | | | | | | | | | | | | | Datetime macros like PyDate_Check() have two implementations, one using the C API capsule and one using direct access to the datetime type symbols defined in _datetimemodule.c. Since the direct access versions of the macros are only used in _datetimemodule.c, they have been moved out of "datetime.h" and into _datetimemodule.c. The _PY_DATETIME_IMPL macro is currently necessary in order to avoid both duplicate definitions of these macros in _datetimemodule.c and unnecessary declarations of C API capsule-related macros and varibles in datetime.h. Co-Authored-By: Victor Stinner <vstinner@redhat.com>
* bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)Gregory P. Smith2018-11-136-10/+10
| | | | Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER. Project based C Preprocessor namespacing at its finest. :P