summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* bpo-42208: Add _Py_GetLocaleEncoding() (GH-23050)Victor Stinner2020-10-316-110/+112
| | | | | | | | _io.TextIOWrapper no longer calls getpreferredencoding(False) of _bootlocale to get the locale encoding, but calls _Py_GetLocaleEncoding() instead. Add config_get_fs_encoding() sub-function. Reorganize also config_get_locale_encoding() code.
* bpo-42214: Fix check for NOTEQUAL token in the PEG parser for the ↵Pablo Galindo2020-10-306-5/+23
| | | | barry_as_flufl rule (GH-23048)
* GitHub Action: Add gdb to posix dependencies (GH-23043)Victor Stinner2020-10-301-6/+6
| | | Sort also dependencies and remove duplicates (liblzma-dev).
* bpo-42208: Call GC collect earlier in PyInterpreterState_Clear() (GH-23044)Victor Stinner2020-10-304-15/+35
| | | | | | | | The last GC collection is now done before clearing builtins and sys dictionaries. Add also assertions to ensure that gc.collect() is no longer called after _PyGC_Fini(). Pass also the tstate to PyInterpreterState_Clear() to pass the correct tstate to _PyGC_CollectNoFail() and _PyGC_Fini().
* bpo-36876: Small adjustments to the C-analyzer tool. (GH-23045)Eric Snow2020-10-3016-218/+633
| | | This is a little bit of clean-up, small fixes, and additional helpers prior to building an updated & accurate list of globals to eliminate.
* bpo-42208: Fix test_gdb for gc_collect_main() name (GH-23041)Victor Stinner2020-10-301-2/+2
| | | | The gcmodule.c collect() function was renamed to gc_collect_main(): update gdb/libpython.py (python-gdb.py).
* bpo-42208: Move _PyImport_Cleanup() to pylifecycle.c (GH-23040)Victor Stinner2020-10-302-230/+290
| | | | | Move _PyImport_Cleanup() to pylifecycle.c, rename it to finalize_modules(), split it (200 lines) into many smaller sub-functions and cleanup the code.
* bpo-42208: Pass tstate to _PyGC_CollectNoFail() (GH-23038)Victor Stinner2020-10-305-34/+25
| | | | | | | | | | | | Move private _PyGC_CollectNoFail() to the internal C API. Remove the private _PyGC_CollectIfEnabled() which was just an alias to the public PyGC_Collect() function since Python 3.8. Rename functions: * collect() => gc_collect_main() * collect_with_callback() => gc_collect_with_callback() * collect_generations() => gc_collect_generations()
* DOC: attribute PyPy for the idea behind LOAD_ATTR cache (GH-23036)Matti Picus2020-10-301-1/+1
| | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-42206: Propagate and raise errors from PyAST_Validate in the parser ↵Batuhan Taskaya2020-10-302-1/+5
| | | | (GH-23035)
* bpo-42172: Correct typo for test_socket.py (GH-23013)Akashkumar D Khunt2020-10-301-3/+3
|
* bpo-42160: tempfile: Reduce overhead of pid check. (GH-22997)Eric W2020-10-303-14/+13
| | | | The _RandomSequence class in tempfile used to check the current pid every time its rng property was used. This commit replaces this code with `os.register_at_fork` to reduce the overhead.
* bpo-42198: Link to GenericAlias in typing and expressions (GH-23030)kj2020-10-302-44/+75
| | | Follow up to 7cdf30fff39ea97f403b5472096349998d190e30 and 4173320920706b49a004bdddd8d7108e8984e3fc. This addresses the point "1. Update links in typing, subscription and union to point to GenericAlias." in the bpo for this PR.
* bpo-42061: Document __format__ for IP addresses (GH-23018)Teugea Ioan-Teodor2020-10-293-4/+39
| | | Automerge-Triggered-By: GH:ericvsmith
* bpo-42180: fix plural in arguments and control (GH-23015)Rafael Fontenelle2020-10-291-1/+1
| | | https://bugs.python.org/issue42180
* bpo-42029: Remove IRIX code (GH-23023)Victor Stinner2020-10-294-25/+8
| | | | IRIX code was slowy removed in Python 2.4 (--with-sgi-dl), Python 3.3 (Irix threads), and Python 3.7.
* bpo-42143: Ensure PyFunction_NewWithQualName() can't fail after creating the ↵Yonatan Goldschmidt2020-10-292-13/+18
| | | | | | func object (GH-22953) func_dealloc() does not handle partially-created objects. Best not to give it any.
* bpo-34204: Use pickle.DEFAULT_PROTOCOL in shelve (GH-19639)Zackery Spytz2020-10-295-8/+29
| | | | Use pickle.DEFAULT_PROTOCOL (currently 5) in shelve instead of a hardcoded 3.
* bpo-41805: Documentation for PEP 585 (GH-22615)kj2020-10-274-0/+211
|
* bpo-42161: Micro-optimize _collections._count_elements() (GH-23008)Victor Stinner2020-10-271-4/+5
| | | Move the _PyLong_GetOne() call outside the fast-path loop.
* bpo-42161: Remove private _PyLong_Zero and _PyLong_One (GH-23003)Victor Stinner2020-10-273-23/+0
| | | | | Use PyLong_FromLong(0) and PyLong_FromLong(1) of the public C API instead. For Python internals, _PyLong_GetZero() and _PyLong_GetOne() of pycore_long.h can be used.
* bpo-42099: Fix reference to ob_type in unionobject.c and ceval (GH-22829)Neil Schemenauer2020-10-272-2/+2
| | | * Use Py_TYPE() rather than o->ob_type.
* bpo-41659: Disallow curly brace directly after primary (GH-22996)Lysandros Nikolaou2020-10-275-167/+244
|
* bpo-6761: Enhance __call__ documentation (GH-7987)Andre Delfino2020-10-271-1/+1
|
* bpo-42161: Modules/ uses _PyLong_GetZero() and _PyLong_GetOne() (GH-22998)Victor Stinner2020-10-2714-36/+57
| | | | | | Use _PyLong_GetZero() and _PyLong_GetOne() in Modules/ directory. _cursesmodule.c and zoneinfo.c are now built with Py_BUILD_CORE_MODULE macro defined.
* bpo-41474, Makefile: Add dependency on cpython/frameobject.h (GH-22999)Victor Stinner2020-10-271-0/+1
| | | Co-Authored-By: Skip Montanaro <skip.montanaro@gmail.com>
* bpo-42157: Rename unicodedata.ucnhash_CAPI (GH-22994)Victor Stinner2020-10-275-5/+13
| | | | | | | Removed the unicodedata.ucnhash_CAPI attribute which was an internal PyCapsule object. The related private _PyUnicode_Name_CAPI structure was moved to the internal C API. Rename unicodedata.ucnhash_CAPI as unicodedata._ucnhash_CAPI.
* bpo-42161: Use _PyLong_GetZero() and _PyLong_GetOne() (GH-22995)Victor Stinner2020-10-279-40/+68
| | | | Use _PyLong_GetZero() and _PyLong_GetOne() in Objects/ and Python/ directories.
* bpo-30681: Support invalid date format or value in email Date header (GH-22090)Georges Toth2020-10-2710-5/+59
| | | | | | | | | | | | | | | | | | | | I am re-submitting an older PR which was abandoned but is still relevant, #10783 by @timb07. The issue being solved () is still relevant. The original PR #10783 was closed as the final request changes were not applied and since abandoned. In this new PR I have re-used the original patch plus applied both comments from the review, by @maxking and @pganssle. For reference, here is the original PR description: In email.utils.parsedate_to_datetime(), a failure to parse the date, or invalid date components (such as hour outside 0..23) raises an exception. Document this behaviour, and add tests to test_email/test_utils.py to confirm this behaviour. In email.headerregistry.DateHeader.parse(), check when parsedate_to_datetime() raises an exception and add a new defect InvalidDateDefect; preserve the invalid value as the string value of the header, but set the datetime attribute to None. Add tests to test_email/test_headerregistry.py to confirm this behaviour; also added test to test_email/test_inversion.py to confirm emails with such defective date headers round trip successfully. This pull request incorporates feedback gratefully received from @bitdancer, @brettcannon, @Mariatta and @warsaw, and replaces the earlier PR #2254. Automerge-Triggered-By: GH:warsaw
* bpo-42161: Add _PyLong_GetZero() and _PyLong_GetOne() (GH-22993)Victor Stinner2020-10-266-25/+67
| | | | | | Add _PyLong_GetZero() and _PyLong_GetOne() functions and a new internal pycore_long.h header file. Python cannot be built without small integer singletons anymore.
* bpo-42123: Run the parser two times and only enable invalid rules on the ↵Lysandros Nikolaou2020-10-266-50/+70
| | | | | | | | | | second run (GH-22111) * Implement running the parser a second time for the errors messages The first parser run is only responsible for detecting whether there is a `SyntaxError` or not. If there isn't the AST gets returned. Otherwise, the parser is run a second time with all the `invalid_*` rules enabled so that all the customized error messages get produced.
* bpo-42157: Convert unicodedata.UCD to heap type (GH-22991)Victor Stinner2020-10-263-84/+56
| | | | | | | Convert the unicodedata extension module to the multiphase initialization API (PEP 489) and convert the unicodedata.UCD static type to a heap type. Co-Authored-By: Mohamed Koubaa <koubaa.m@gmail.com>
* bpo-42157: unicodedata avoids references to UCD_Type (GH-22990)Victor Stinner2020-10-267-136/+126
| | | | | | | | | | * UCD_Check() uses PyModule_Check() * Simplify the internal _PyUnicode_Name_CAPI structure: * Remove size and state members * Remove state and self parameters of getcode() and getname() functions * Remove global_module_state
* bpo-39101: Fixes BaseException hang in IsolatedAsyncioTestCase. (GH-22654)Lisa Roach2020-10-263-2/+30
|
* bpo-1635741: _PyUnicode_Name_CAPI moves to internal C API (GH-22713)Victor Stinner2020-10-2611-49/+74
| | | | | | | | | | The private _PyUnicode_Name_CAPI structure of the PyCapsule API unicodedata.ucnhash_CAPI moves to the internal C API. Moreover, the structure gets a new state member which must be passed to the getcode() and getname() functions. * Move Include/ucnhash.h to Include/internal/pycore_ucnhash.h * unicodedata module is now built with Py_BUILD_CORE_MODULE. * unicodedata: move hashAPI variable into unicodedata_module_state.
* bpo-42152: Use PyDict_Contains and PyDict_SetDefault if appropriate. (GH-22986)Serhiy Storchaka2020-10-2611-163/+135
| | | | | | | If PyDict_GetItemWithError is only used to check whether the key is in dict, it is better to use PyDict_Contains instead. And if it is used in combination with PyDict_SetItem, PyDict_SetDefault can replace the combination.
* bpo-42006: Stop using PyDict_GetItem, PyDict_GetItemString and ↵Serhiy Storchaka2020-10-2617-137/+254
| | | | | | | | | | | _PyDict_GetItemId. (GH-22648) These functions are considered not safe because they suppress all internal errors and can return wrong result. PyDict_GetItemString and _PyDict_GetItemId can also silence current exception in rare cases. Remove no longer used _PyDict_GetItemId. Add _PyDict_ContainsId and rename _PyDict_Contains into _PyDict_Contains_KnownHash.
* Added some makefile generated files to .gitignore (GH-22435)Marco Sulla2020-10-261-0/+2
|
* Add a link to buffer protocol in bytearray() doc (GH-22675)Antoine2020-10-261-2/+2
|
* bpo-42146: Fix memory leak in subprocess.Popen() in case of uid/gid overflow ↵Alexey Izbyshev2020-10-263-2/+17
| | | | | | | | | | | (GH-22966) Fix memory leak in subprocess.Popen() in case of uid/gid overflow Also add a test that would catch this leak with `--huntrleaks`. Alas, the test for `extra_groups` also exposes an inconsistency in our error reporting: we use a custom ValueError for `extra_groups`, but propagate OverflowError for `user` and `group`.
* bpo-42150: Avoid buffer overflow in the new parser (GH-22978)Pablo Galindo2020-10-252-1/+4
|
* bpo-42043: Add support for zipfile.Path subclasses (#22716)Jason R. Coombs2020-10-253-115/+240
| | | | | * bpo-42043: Add support for zipfile.Path inheritance as introduced in zipp 3.2.0. * Add blurb.
* bpo-41919: Avoid resource leak in test_io (GH-22973)Hai Shi2020-10-251-12/+13
| | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-41490: ``path`` and ``contents`` to aggressively close handles (#22915)Jason R. Coombs2020-10-257-16/+114
| | | | | | | | | * bpo-41490: ``path`` method to aggressively close handles * Add blurb * In ZipReader.contents, eagerly evaluate the contents to release references to the zipfile. * Instead use _ensure_sequence to ensure any iterable from a reader is eagerly converted to a list if it's not already a sequence.
* bpo-42144: Add a missing "goto error;" in the _ssl module (GH-22959)Zackery Spytz2020-10-251-0/+1
|
* bpo-39108: Document threading issues for random.gauss() (GH-22928)Raymond Hettinger2020-10-251-0/+7
|
* Split-out a fourth section in the descriptor HowTo guide (GH-22965)Raymond Hettinger2020-10-251-46/+50
|
* Correctly compare the hint against the keys in _PyDict_GetItemHint (GH-22960)Pablo Galindo2020-10-251-1/+1
|
* Second round of updates to the descriptor howto guide (GH-22946)Raymond Hettinger2020-10-251-96/+156
|
* bpo-33987: Add master ttk Frame to IDLE search dialogs (GH-22942)Mark Roseman2020-10-254-14/+25
|