summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-39573: Add Py_SET_TYPE() function (GH-18394)Victor Stinner2020-02-0724-48/+77
| | | Add Py_SET_TYPE() function to set the type of an object.
* bpo-39573: Use Py_TYPE() macro in Modules directory (GH-18393)Victor Stinner2020-02-0726-40/+40
| | | Replace direct access to PyObject.ob_type with Py_TYPE().
* bpo-39573: Use Py_TYPE() macro in Objects directory (GH-18392)Victor Stinner2020-02-0720-109/+109
| | | Replace direct access to PyObject.ob_type with Py_TYPE().
* bpo-39573: Use Py_TYPE() macro in Python and Include directories (GH-18391)Victor Stinner2020-02-0712-39/+39
| | | Replace direct access to PyObject.ob_type with Py_TYPE().
* bpo-39491: Mention Annotated in get_origin() docstring (GH-18379)Jakub Stasiak2020-02-071-2/+2
| | | I forgot to do it in https://github.com/python/cpython/pull/18260.
* bpo-39573: Use Py_TYPE() in abstract.c (GH-18390)Victor Stinner2020-02-071-94/+94
| | | Replace direct access to PyObject.ob_type with Py_TYPE().
* bpo-39571: Fix clang warning on PyTypeObject typedef (GH-18385)Victor Stinner2020-02-071-2/+2
| | | Only define PyTypeObject type once.
* bpo-39573: Add Py_SET_REFCNT() function (GH-18389)Victor Stinner2020-02-077-14/+30
| | | | Add a Py_SET_REFCNT() function to set the reference counter of an object.
* bpo-39573: Use Py_REFCNT() macro (GH-18388)Victor Stinner2020-02-069-38/+42
| | | | Replace direct acccess to PyObject.ob_refcnt with usage of the Py_REFCNT() macro.
* bpo-39534: Doc: Clarify return in finally (GH-18324)Julien Palard2020-02-061-9/+27
|
* What's New in Python 3.9: sort improved modules (GH-18383)Victor Stinner2020-02-061-36/+36
|
* bpo-39542: Document limited C API changes (GH-18378)Victor Stinner2020-02-061-7/+42
|
* bpo-39274: Ensure Fraction.__bool__() returns a bool (GH-18017)Sebastian Berg2020-02-063-1/+41
| | | | | Some numerator types used (specifically NumPy) decides to not return a Python boolean for the "a != b" operation. Using the equivalent call to bool() guarantees a bool return also for such types.
* bpo-39245: Make Vectorcall C API public (GH-17893)Petr Viktorin2020-02-065-66/+89
| | | | | | | | | | | | | | | | | * Add backcompat defines and move non-limited API declaration to cpython/ This partially reverts commit 2ff58a24e8a1c7e290d025d69ebaea0bbead3b8c which added PyObject_CallNoArgs to the 3.9+ stable ABI. This should not be done; there are enough other call APIs in the stable ABI to choose from. * Adjust documentation Mark all newly public functions as added in 3.9. Add a note about the 3.8 provisional names. Add notes on public API. * Put PyObject_CallNoArgs back in the limited API * Rename PyObject_FastCallDict to PyObject_VectorcallDict
* bpo-38823: Fix refleaks in _ast initialization error path (GH-17276)Brandt Bucher2020-02-062-184/+372
|
* bpo-38149: Call sys.audit() only once per call for glob.glob(). (GH-18360)Serhiy Storchaka2020-02-062-1/+3
|
* bpo-39555: Fix distutils test to handle _d suffix on Windows debug build ↵Steve Dower2020-02-061-2/+2
| | | | (GH-18357)
* bpo-39127: Make _Py_HashPointer's argument be const (GH-17690)Andy Lester2020-02-052-2/+2
|
* bpo-39559: Remove unused, undocumented argument from uuid.getnode (GH-18369)Shantanu2020-02-052-1/+2
|
* bpo-39542: Declare _Py_AddToAllObjects() in pycore_object.h (GH-18368)Victor Stinner2020-02-053-2/+4
| | | | | | _Py_AddToAllObjects() is used in bltinmodule.c and typeobject.c when Py_TRACE_REFS is defined. Fix Py_TRACE_REFS build.
* bpo-39488: Skip test_largefile tests if not enough disk space (GH-18261)Giampaolo Rodola2020-02-051-0/+18
|
* Add PyInterpreterState.fs_codec.utf8 (GH-18367)Victor Stinner2020-02-052-46/+48
| | | | | | Add a fast-path for UTF-8 encoding in PyUnicode_EncodeFSDefault() and PyUnicode_DecodeFSDefaultAndSize(). Add _PyUnicode_FiniEncodings() helper function for _PyUnicode_Fini().
* bpo-39542: Define PyTypeObject earlier in object.h (GH-18366)Victor Stinner2020-02-051-20/+16
| | | Replace "struct _typeobject" with PyTypeObject in object.h.
* bpo-39542: Convert PyType_Check() to static inline function (GH-18364)Victor Stinner2020-02-054-17/+30
| | | | Convert PyType_HasFeature(), PyType_Check() and PyType_CheckExact() macros to static inline functions.
* bpo-39542: Make PyObject_INIT() opaque in limited C API (GH-18363)Victor Stinner2020-02-056-49/+77
| | | | | | | | | | | | | | In the limited C API, PyObject_INIT() and PyObject_INIT_VAR() are now defined as aliases to PyObject_Init() and PyObject_InitVar() to make their implementation opaque. It avoids to leak implementation details in the limited C API. Exclude the following functions from the limited C API, move them from object.h to cpython/object.h: * _Py_NewReference() * _Py_ForgetReference() * _PyTraceMalloc_NewReference() * _Py_GetRefTotal()
* bpo-39542: Exclude trashcan from the limited C API (GH-18362)Victor Stinner2020-02-053-87/+89
| | | | | | | | Exclude trashcan mechanism from the limited C API: it requires access to PyTypeObject and PyThreadState structure fields, whereas these structures are opaque in the limited C API. The trashcan mechanism never worked with the limited C API. Move it from object.h to cpython/object.h.
* bpo-39543: Remove unused _Py_Dealloc() macro (GH-18361)Victor Stinner2020-02-052-12/+0
| | | | | | | | | | | | The macro is defined after Py_DECREF() and so is no longer used by Py_DECREF(). Moving _Py_Dealloc() macro back from cpython/object.h to object.h would require to move a lot of definitions as well: PyTypeObject and many related types used by PyTypeObject. Keep _Py_Dealloc() as an opaque function call to avoid leaking implementation details in the limited C API (object.h): remove _Py_Dealloc() macro from cpython/object.h.
* bpo-39505: delete the redundant '/' in $env:VIRTUAL_ENV (GH-18290)schwarzichet2020-02-051-1/+0
|
* bpo-39553: Delete HAVE_SXS protected code (GH-18356)Zackery Spytz2020-02-054-95/+1
| | | | | | | https://bugs.python.org/issue39553 Automerge-Triggered-By: @zooba
* bpo-39491: Merge PEP 593 (typing.Annotated) support (#18260)Jakub Stasiak2020-02-055-6/+467
| | | | | | | | | | | | | | | | | | | | | | | | | * bpo-39491: Merge PEP 593 (typing.Annotated) support PEP 593 has been accepted some time ago. I got a green light for merging this from Till, so I went ahead and combined the code contributed to typing_extensions[1] and the documentation from the PEP 593 text[2]. My changes were limited to: * removing code designed for typing_extensions to run on older Python versions * removing some irrelevant parts of the PEP text when copying it over as documentation and otherwise changing few small bits to better serve the purpose * changing the get_type_hints signature to match reality (parameter names) I wasn't entirely sure how to go about crediting the authors but I used my best judgment, let me know if something needs changing in this regard. [1] https://github.com/python/typing/blob/8280de241fd8c8afe727c7860254b753e383b360/typing_extensions/src_py3/typing_extensions.py [2] https://github.com/python/peps/blob/17710b879882454d55f82c2d44596e8e9f8e4bff/pep-0593.rst
* bpo-39185 Add the d[etailed] and q[uiet] verbosity levels for msbuild (GH-17791)Anthony Shaw2020-02-052-0/+5
|
* bpo-39184: Add audit events to command execution functions in os and pty ↵Saiyang Gou2020-02-055-7/+56
| | | | modules (GH-17824)
* bpo-39542: Make _Py_NewReference() opaque in C API (GH-18346)Victor Stinner2020-02-055-55/+54
| | | | | | | | | | _Py_NewReference() becomes a regular opaque function, rather than a static inline function in the C API (object.h), to better hide implementation details. Move _Py_tracemalloc_config from public pymem.h to internal pycore_pymem.h header. Make _Py_AddToAllObjects() private.
* Fix MinGW library generation command (GH-17917)Baljak2020-02-051-1/+1
| | | To print the exports to stdout, the gendef command requires the option "-". Without this option, no output is generated.
* closes bpo-39510: Fix use-after-free in BufferedReader.readinto() (GH-18295)Philipp Gesang2020-02-043-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | When called on a closed object, readinto() segfaults on account of a write to a freed buffer: ==220553== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==220553== Access not within mapped region at address 0x2A ==220553== at 0x48408A0: memmove (vg_replace_strmem.c:1272) ==220553== by 0x58DB0C: _buffered_readinto_generic (bufferedio.c:972) ==220553== by 0x58DCBA: _io__Buffered_readinto_impl (bufferedio.c:1053) ==220553== by 0x58DCBA: _io__Buffered_readinto (bufferedio.c.h:253) Reproducer: reader = open ("/dev/zero", "rb") _void = reader.read (42) reader.close () reader.readinto (bytearray (42)) ### BANG! The problem exists since 2012 when commit dc469454ec added code to free the read buffer on close(). Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
* bpo-39432: Implement PEP-489 algorithm for non-ascii "PyInit_*" symbol names ↵Stefan Behnel2020-02-043-1/+23
| | | | | | | | | in distutils (GH-18150) Make it export the correct init symbol also on Windows. https://bugs.python.org/issue39432
* Restore PyObject_IsInstance() comment (GH-18345)Victor Stinner2020-02-041-17/+23
| | | | | | | | | | | | Restore PyObject_IsInstance() comment explaining why only tuples of types are accepted, but not general sequence. Comment written by Guido van Rossum in commit 03290ecbf1661c0192e6abdbe00ae163af461d77 which implements isinstance(x, (A, B, ...)). The comment was lost in a PyObject_IsInstance() optimization: commit ec569b794737be248671d0dfac11b664fc930eef. Cleanup also the code. recursive_isinstance() is no longer recursive, so rename it to object_isinstance(), whereas object_isinstance() is recursive and so rename it to object_recursive_isinstance().
* bpo-38076 Clear the interpreter state only after clearing module globals ↵Eddie Elizondo2020-02-045-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-18039) Currently, during runtime destruction, `_PyImport_Cleanup` is clearing the interpreter state before clearing out the modules themselves. This leads to a segfault on modules that rely on the module state to clear themselves up. For example, let's take the small snippet added in the issue by @DinoV : ``` import _struct class C: def __init__(self): self.pack = _struct.pack def __del__(self): self.pack('I', -42) _struct.x = C() ``` The module `_struct` uses the module state to run `pack`. Therefore, the module state has to be alive until after the module has been cleared out to successfully run `C.__del__`. This happens at line 606, when `_PyImport_Cleanup` calls `_PyModule_Clear`. In fact, the loop that calls `_PyModule_Clear` has in its comments: > Now, if there are any modules left alive, clear their globals to minimize potential leaks. All C extension modules actually end up here, since they are kept alive in the interpreter state. That means that we can't clear the module state (which is used by C Extensions) before we run that loop. Moving `_PyInterpreterState_ClearModules` until after it, fixes the segfault in the code snippet. Finally, this updates a test in `io` to correctly assert the error that it now throws (since it now finds the io module state). The test that uses this is: `test_create_at_shutdown_without_encoding`. Given this test is now working is a proof that the module state now stays alive even when `__del__` is called at module destruction time. Thus, I didn't add a new tests for this. https://bugs.python.org/issue38076
* add whatsnew that was missed from 31d6de5aba009914efa8f0f3c3d7da35217578eb ↵Chris Withers2020-02-041-0/+2
| | | | (#18344)
* bpo-38558: Link to further docs from walrus operator mention in tutorial ↵Adorilson Bezerra2020-02-032-3/+6
| | | | (GH-16973)
* bpo-39542: Simplify _Py_NewReference() (GH-18332)Victor Stinner2020-02-037-58/+60
| | | | | | | | | * Remove _Py_INC_REFTOTAL and _Py_DEC_REFTOTAL macros: modify directly _Py_RefTotal. * _Py_ForgetReference() is no longer defined if the Py_TRACE_REFS macro is not defined. * Remove _Py_NewReference() implementation from object.c: unify the two implementations in object.h inline function. * Fix Py_TRACE_REFS build: _Py_INC_TPALLOCS() macro has been removed.
* Fixes in sorting descriptions (GH-18317)Stefan Pochmann2020-02-032-9/+9
| | | | | Improvements in listsort.txt and a comment in sortperf.py. Automerge-Triggered-By: @csabella
* bpo-39542: Move object.h debug functions to internal C API (GH-18331)Victor Stinner2020-02-034-7/+11
| | | | | | | | Move the following functions from the public C API to the internal C API: * _PyDebug_PrintTotalRefs(), * _Py_PrintReferenceAddresses() * _Py_PrintReferences()
* bpo-39489: Remove COUNT_ALLOCS special build (GH-18259)Victor Stinner2020-02-0334-469/+24
| | | | | | | | | | | Remove: * COUNT_ALLOCS macro * sys.getcounts() function * SHOW_ALLOC_COUNT code in listobject.c * SHOW_TRACK_COUNT code in tupleobject.c * PyConfig.show_alloc_count field * -X showalloccount command line option * @test.support.requires_type_collecting decorator
* bpo-36051: Fix compiler warning. (GH-18325)Inada Naoki2020-02-031-1/+1
|
* bpo-39450 Stripped whitespace before parsing the docstring in ↵Steve Cirelli2020-02-033-1/+12
| | | | TestCase.shortDescription (GH-18175)
* bpo-39492: Fix a reference cycle between reducer_override and a Pickler ↵Pierre Glaser2020-02-023-4/+43
| | | | | | | | | | | | instance (GH-18266) This also needs a backport to 3.8 https://bugs.python.org/issue39492 Automerge-Triggered-By: @pitrou
* bpo-39349: Add *cancel_futures* to Executor.shutdown() (GH-18057)Kyle Stanley2020-02-026-3/+101
|
* Fix 5-space indentation and trailing whitespace (GH-18311)Mark Dickinson2020-02-021-11/+11
|
* bpo-39496: Remove redundant checks from _sqlite/cursor.c (GH-18270)Alex Henrie2020-02-011-20/+6
|