summaryrefslogtreecommitdiffstats
path: root/Misc
Commit message (Collapse)AuthorAgeFilesLines
* bpo-24416: Return named tuple from date.isocalendar() (GH-20113)Paul Ganssle2020-05-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | {date, datetime}.isocalendar() now return a private custom named tuple object IsoCalendarDate rather than a simple tuple. In order to leave IsocalendarDate as a private class and to improve what backwards compatibility is offered for pickling the result of a datetime.isocalendar() call, add a __reduce__ method to the named tuples that reduces them to plain tuples. (This is the part of this PR most likely to cause problems — if it causes major issues, switching to a strucseq or equivalent would be prudent). The pure python implementation of IsoCalendarDate uses positional-only arguments, since it is private and only constructed by position anyway; the equivalent change in the argument clinic on the C side would require us to move the forward declaration of the type above the clinic import for whatever reason, so it seems preferable to hold off on that for now. bpo-24416: https://bugs.python.org/issue24416 Original PR by Dong-hee Na with only minor alterations by Paul Ganssle. Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-39305: Update nntplib to merge nntplib.NNTP and nntplib._NNTPBase (GH-19817)Dong-hee Na2020-05-161-0/+2
|
* bpo-40192: Use thread_cputime for time.thread_time to improve resolution ↵Batuhan Taskaya2020-05-161-0/+4
| | | | | | | (GH-19381) On AIX, time.thread_time() is now implemented with thread_cputime() which has nanosecond resolution, rather than clock_gettime(CLOCK_THREAD_CPUTIME_ID) which has a resolution of 10 ms.
* bpo-40503: PEP 615: Tests and implementation for zoneinfo (GH-19909)Paul Ganssle2020-05-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the initial implementation of PEP 615, the zoneinfo module, ported from the standalone reference implementation (see https://www.python.org/dev/peps/pep-0615/#reference-implementation for a link, which has a more detailed commit history). This includes (hopefully) all functional elements described in the PEP, but documentation is found in a separate PR. This includes: 1. A pure python implementation of the ZoneInfo class 2. A C accelerated implementation of the ZoneInfo class 3. Tests with 100% branch coverage for the Python code (though C code coverage is less than 100%). 4. A compile-time configuration option on Linux (though not on Windows) Differences from the reference implementation: - The module is arranged slightly differently: the accelerated module is `_zoneinfo` rather than `zoneinfo._czoneinfo`, which also necessitates some changes in the test support function. (Suggested by Victor Stinner and Steve Dower.) - The tests are arranged slightly differently and do not include the property tests. The tests live at test/test_zoneinfo/test_zoneinfo.py rather than test/test_zoneinfo.py or test/test_zoneinfo/__init__.py because we may do some refactoring in the future that would likely require this separation anyway; we may: - include the property tests - automatically run all the tests against both pure Python and C, rather than manually constructing C and Python test classes (similar to the way this works with test_datetime.py, which generates C and Python test cases from datetimetester.py). - This includes a compile-time configuration option on Linux (though not on Windows); added with much help from Thomas Wouters. - Integration into the CPython build system is obviously different from building a standalone zoneinfo module wheel. - This includes configuration to install the tzdata package as part of CI, though only on the coverage jobs. Introducing a PyPI dependency as part of the CI build was controversial, and this is seen as less of a major change, since the coverage jobs already depend on pip and PyPI. Additional changes that were introduced as part of this PR, most / all of which were backported to the reference implementation: - Fixed reference and memory leaks With much debugging help from Pablo Galindo - Added smoke tests ensuring that the C and Python modules are built The import machinery can be somewhat fragile, and the "seamlessly falls back to pure Python" nature of this module makes it so that a problem building the C extension or a failure to import the pure Python version might easily go unnoticed. - Adjustments to zoneinfo.__dir__ Suggested by Petr Viktorin. - Slight refactorings as suggested by Steve Dower. - Removed unnecessary if check on std_abbr Discovered this because of a missing line in branch coverage.
* bpo-40457: Support OpenSSL without TLS 1.0/1.1 (GH-19862)Christian Heimes2020-05-161-0/+1
| | | | | | | | | | | OpenSSL can be build without support for TLS 1.0 and 1.1. The ssl module now correctly adheres to OPENSSL_NO_TLS1 and OPENSSL_NO_TLS1_1 flags. Also update multissltest to test with latest OpenSSL and LibreSSL releases. Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: @tiran
* bpo-39075: types.SimpleNamespace no longer sorts attributes in its repr ↵Zackery Spytz2020-05-161-0/+2
| | | | (GH-19430)
* bpo-31033: Add a msg argument to Future.cancel() and Task.cancel() (GH-19979)Chris Jerdonek2020-05-151-0/+1
|
* Add Andrew York to ACKS for GH-19622. (GH-20105)Chris Jerdonek2020-05-151-0/+1
| | | | This updates ACKS for commit 003708bcf8f2c58d4b65f68318acf164d713e008 contributed by Andrew York.
* bpo-40637: Add option to disable builtin hashes (GH-20121)Christian Heimes2020-05-151-0/+2
| | | | | Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: @tiran
* bpo-40163: Fix multissltest download of old OpenSSL (GH-19329)Christian Heimes2020-05-151-0/+3
|
* bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() ↵romasku2020-05-152-0/+4
| | | | | | | | | | | | | | | (GH-20054) Currently, if asyncio.wait_for() timeout expires, it cancels inner future and then always raises TimeoutError. In case those future is task, it can handle cancelation mannually, and those process can lead to some other exception. Current implementation silently loses thoses exception. To resolve this, wait_for will check was the cancelation successfull or not. In case there was exception, wait_for will reraise it. Co-authored-by: Roman Skurikhin <roman.skurikhin@cruxlab.com>
* bpo-40515: Require OPENSSL_THREADS (GH-19953)Christian Heimes2020-05-151-0/+3
| | | | | | | The ``ssl`` and ``hashlib`` modules now actively check that OpenSSL is build with thread support. Python 3.7.0 made thread support mandatory and no longer works safely with a no-thread builds. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-40479: Test with latest OpenSSL versions (GH-20108)Christian Heimes2020-05-151-0/+2
| | | | | | | | | | | | | * 1.0.2u (EOL) * 1.1.0l (EOL) * 1.1.1g * 3.0.0-alpha2 (disabled for now) Build the FIPS provider and create a FIPS configuration file for OpenSSL 3.0.0. Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: @tiran
* bpo-40479: Fix hashlib issue with OpenSSL 3.0.0 (GH-20107)Christian Heimes2020-05-151-0/+1
| | | | | | | | | | OpenSSL 3.0.0-alpha2 was released today. The FIPS_mode() function has been deprecated and removed. It no longer makes sense with the new provider and context system in OpenSSL 3.0.0. EVP_default_properties_is_fips_enabled() is good enough for our needs in unit tests. It's an internal API, too. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)Victor Stinner2020-05-151-0/+3
| | | | | distutils.tests now saves/restores warnings filters to leave them unchanged. Importing tests imports docutils which imports pkg_resources which adds a warnings filter.
* bpo-40612: Fix SyntaxError edge cases in traceback formatting (GH-20072)Guido van Rossum2020-05-151-0/+2
| | | | | | | | | | | | | This fixes both the traceback.py module and the C code for formatting syntax errors (in Python/pythonrun.c). They now both consistently do the following: - Suppress caret if it points left of text - Allow caret pointing just past end of line - If caret points past end of line, clip to *just* past end of line The syntax error formatting code in traceback.py was mostly rewritten; small, subtle changes were applied to the C code in pythonrun.c. There's still a difference when the text contains embedded newlines. Neither handles these very well, and I don't think the case occurs in practice. Automerge-Triggered-By: @gvanrossum
* bpo-40495: compileall option to hardlink duplicate pyc files (GH-19901)Lumír 'Frenzy' Balhar2020-05-142-0/+3
| | | | | | | compileall is now able to use hardlinks to prevent duplicates in a case when .pyc files for different optimization levels have the same content. Co-authored-by: Miro Hrončok <miro@hroncok.cz> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40597: email: Use CTE if lines are longer than max_line_length ↵Arkadiusz Hiler2020-05-141-0/+1
| | | | | | | | | | | | | | | consistently (gh-20038) raw_data_manager (default for EmailPolicy, EmailMessage) does correct wrapping of 'text' parts as long as the message contains characters outside of 7bit US-ASCII set: base64 or qp Content-Transfer-Encoding is applied if the lines would be too long without it. It did not, however, do this for ascii-only text, which could result in lines that were longer than policy.max_line_length or even the rfc 998 maximum. This changeset fixes the heuristic so that if lines are longer than policy.max_line_length, it will always apply a content-transfer-encoding so that the lines are wrapped correctly.
* bpo-39465: Remove _PyUnicode_ClearStaticStrings() from C API (GH-20078)Victor Stinner2020-05-131-0/+1
| | | | Remove the _PyUnicode_ClearStaticStrings() function from the C API. Make the function fully private (declare it with "static").
* bpo-34790: add version of removal of explicit passing of coros to ↵jack11422020-05-131-0/+1
| | | | `asyncio.wait`'s documentation (#20008)
* bpo-40501: Replace ctypes code in uuid with native module (GH-19948)Steve Dower2020-05-121-0/+2
|
* bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks (GH-20024)scoder2020-05-121-0/+2
| | | | | … now that we allow subtypes of PyCFunction. Also add PyCMethod_CheckExact() and PyCMethod_Check() for checks against the PyCMethod subtype.
* bpo-40596: Fix str.isidentifier() for non-canonicalized strings containing ↵Serhiy Storchaka2020-05-121-0/+2
| | | | non-BMP characters on Windows. (GH-20053)
* bpo-40593: Improve syntax errors for invalid characters in source code. ↵Serhiy Storchaka2020-05-121-0/+1
| | | | (GH-20033)
* bpo-40571: Make lru_cache(maxsize=None) more discoverable (GH-20019)Raymond Hettinger2020-05-121-0/+2
|
* bpo-40561: Add docstrings for webbrowser open functions (GH-19999)Brad Solomon2020-05-111-0/+1
| | | | Co-authored-by: Brad Solomon <brsolomon@deloitte.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-40585: Normalize errors messages in codeop when comparing them (GH-20030)Pablo Galindo2020-05-111-0/+2
| | | | | | With the new parser, the error message contains always the trailing newlines, causing the comparison of the repr of the error messages in codeop to fail. This commit makes the new parser mirror the old parser's behaviour regarding trailing newlines.
* bpo-37986: Improve perfomance of PyLong_FromDouble() (GH-15611)Sergey Fedoseev2020-05-101-0/+2
| | | | | | | | | * bpo-37986: Improve perfomance of PyLong_FromDouble() * Use strict bound check for safety and symmetry * Remove possibly outdated performance claims Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-40549: Convert posixmodule.c to multiphase init (GH-19982)Victor Stinner2020-05-101-0/+2
| | | | | | | | | | | | | | | Convert posixmodule.c ("posix" or "nt" module) to the multiphase initialization (PEP 489). * Create the module using PyModuleDef_Init(). * Create ScandirIteratorType and DirEntryType with the new PyType_FromModuleAndSpec() (PEP 573) * Get the module state from ScandirIteratorType and DirEntryType with the new PyType_GetModule() (PEP 573) * Pass module to functions which access the module state. * convert_sched_param() gets a new module parameter. It is now called directly since Argument Clinic doesn't support passing the module to an argument converter callback. * Remove _posixstate_global macro.
* bpo-40397: Remove __args__ and __parameters__ from _SpecialGenericAlias ↵Serhiy Storchaka2020-05-101-0/+2
| | | | (GH-19984)
* bpo-40566: Apply PEP 573 to abc module (GH-20005)Dong-hee Na2020-05-091-0/+1
|
* bpo-39791: Add files() to importlib.resources (GH-19722)Jason R. Coombs2020-05-081-0/+1
| | | | | | | | | * bpo-39791: Update importlib.resources to support files() API (importlib_resources 1.5). * 📜🤖 Added by blurb_it. * Add some documentation about the new objects added. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-40502: Initialize n->n_col_offset (GH-19988)Joannah Nanjekye2020-05-081-0/+2
| | | | | | | | | | * initialize n->n_col_offset * 📜🤖 Added by blurb_it. * Move initialization Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-40541: Add optional *counts* parameter to random.sample() (GH-19970)Raymond Hettinger2020-05-081-0/+1
|
* bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)Chris Jerdonek2020-05-081-0/+1
| | | | This fixes a possible memory leak in the C implementation of asyncio.Task.
* bpo-40273: Reversible mappingproxy (FH-19513)Zackery Spytz2020-05-081-0/+1
|
* bpo-40545: Export _PyErr_GetTopmostException() function (GH-19978)Victor Stinner2020-05-071-0/+3
| | | | | | | Declare _PyErr_GetTopmostException() with PyAPI_FUNC() to properly export the function in the C API. The function remains private ("_Py") prefix. Co-Authored-By: Julien Danjou <julien@danjou.info>
* bpo-38787: C API for module state access from extension methods (PEP 573) ↵Petr Viktorin2020-05-071-0/+2
| | | | | | | | | (GH-19936) Module C state is now accessible from C-defined heap type methods (PEP 573). Patch by Marcel Plch and Petr Viktorin. Co-authored-by: Marcel Plch <mplch@redhat.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-1635741: Port errno module to multiphase initialization (GH-19923)Dong-hee Na2020-05-071-0/+1
|
* bpo-40527: Fix command line argument parsing (GH-19955)Victor Stinner2020-05-061-0/+2
|
* bpo-40480 "fnmatch" exponential execution time (GH-19908)Tim Peters2020-05-061-0/+1
| | | | | bpo-40480: create different regexps in the presence of multiple `*` patterns to prevent fnmatch() from taking exponential time.
* bpo-40523: Add pass-throughs for hash() and reversed() to weakref.proxy ↵Pablo Galindo2020-05-051-0/+2
| | | | objects (GH-19946)
* bpo-40504: Allow weakrefs to lru_cache objects (GH-19938)Dennis Sweeney2020-05-051-0/+1
|
* bpo-40355: Improve error messages in ast.literal_eval with malformed Dict ↵Curtis Bucher2020-05-051-0/+2
| | | | | nodes (GH-19868) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-40458: Increase reserved stack space to prevent overflow crash on ↵Steve Dower2020-05-051-0/+1
| | | | Windows (GH-19845)
* bpo-40514: Add --with-experimental-isolated-subinterpreters (GH-19926)Victor Stinner2020-05-051-0/+2
| | | | | | | Add --with-experimental-isolated-subinterpreters build option to configure: better isolate subinterpreters, experimental build mode. When used, force the usage of the libc malloc() memory allocator, since pymalloc relies on the unique global interpreter lock (GIL).
* bpo-40459: Fix NameError in platform.py (GH-19855)Dennis Sweeney2020-05-051-0/+1
|
* bpo-1635741: Port syslog module to multiphase initialization (GH-19907)Dong-hee Na2020-05-051-0/+1
|
* bpo-40499: Mention that asyncio.wait() needs a non-empty aws set (GH-19900)Joel Rosdahl2020-05-042-0/+2
| | | | | A similar formulation was added in bpo-21596 (db74d982d43d98040e38665d843cbc8de4a082b1) but was lost in bpo-33649 (3faaa8857a42a36383bb18425444e597fc876797).
* bpo-40246: Revert reporting of invalid string prefixes (GH-19888)Lysandros Nikolaou2020-05-041-0/+1
| | | | Due to backwards compatibility concerns regarding keywords immediately followed by a string without whitespace between them (like in `bg="#d00" if clear else"#fca"`) will fail to parse, commit 41d5b94af44e34ac05d4cd57460ed104ccf96628 has to be reverted.