summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-113664: Improve style of Big O notation (GH-113695)Serhiy Storchaka2024-01-1016-27/+27
| | | | Use cursive to make it looking like mathematic formulas.
* gh-113594: Fix UnicodeEncodeError in TokenList.fold() (GH-113730)Serhiy Storchaka2024-01-103-0/+48
| | | It occurred when try to re-encode an unknown-8bit part combined with non-unknown-8bit part.
* gh-70835: Clarify error message for CSV file opened with wrong newline ↵Serhiy Storchaka2024-01-102-8/+14
| | | | | (GH-113786) Based on patch by SilentGhost.
* gh-96037: Always insert TimeoutError when exit an expired asyncio.timeout() ↵Serhiy Storchaka2024-01-103-13/+133
| | | | | | | | block (GH-113819) If other exception was raised during exiting an expired asyncio.timeout() block, insert TimeoutError in the exception context just above the CancelledError.
* gh-113879: Fix ResourceWarning in test_asyncio.test_server (GH-113881)Serhiy Storchaka2024-01-101-14/+14
|
* gh-113877: Fix Tkinter method winfo_pathname() on 64-bit Windows (GH-113900)Serhiy Storchaka2024-01-103-0/+15
| | | | | winfo_id() converts the result of "winfo id" command to integer, but "winfo pathname" command requires an argument to be a hexadecimal number on Win64.
* GH-113858: GitHub Actions config: Only save ccache on pushes (GH-113859)Petr Viktorin2024-01-102-0/+10
|
* gh-112182: Replace StopIteration with RuntimeError for future (#113220)Jamie Phan2024-01-104-12/+49
| | | | | | When an `StopIteration` raises into `asyncio.Future`, this will cause a thread to hang. This commit address this by not raising an exception and silently transforming the `StopIteration` with a `RuntimeError`, which the caller can reconstruct from `fut.exception().__cause__`
* pathlib ABCs: Require one or more initialiser arguments (#113885)Barney Gale2024-01-102-32/+26
| | | | | | | Refuse to guess what a user means when they initialise a pathlib ABC without any positional arguments. In mainline pathlib it's normalised to `.`, but in the ABCs this guess isn't appropriate; for example, the path type may not represent the current directory as `.`, or may have no concept of a "current directory" at all.
* GH-113528: Deoptimise `pathlib._abc.PurePathBase` (#113559)Barney Gale2024-01-094-140/+195
| | | | | | | Apply pathlib's normalization and performance tuning in `pathlib.PurePath`, but not `pathlib._abc.PurePathBase`. With this change, the pathlib ABCs do not normalize away alternate path separators, empty segments, or dot segments. A single string given to the initialiser will round-trip by default, i.e. `str(PurePathBase(my_string)) == my_string`. Implementors can set their own path domain-specific normalization scheme by overriding `__str__()` Eliminating path normalization makes maintaining and caching the path's parts and string representation both optional and not very useful, so this commit moves the `_drv`, `_root`, `_tail_cached` and `_str` slots from `PurePathBase` to `PurePath`. Only `_raw_paths` and `_resolving` slots remain in `PurePathBase`. This frees the ABCs from the burden of some of pathlib's hardest-to-understand code.
* gh-111968: Introduce _PyFreeListState and _PyFreeListState_GET API (gh-113584)Donghee Na2024-01-0917-50/+171
|
* GH-113528: Deoptimise `pathlib._abc.PurePathBase.relative_to()` (again) ↵Barney Gale2024-01-092-15/+42
| | | | | | | | | (#113882) Restore full battle-tested implementations of `PurePath.[is_]relative_to()`. These were recently split up in 3375dfe and a15a773. In `PurePathBase`, add entirely new implementations based on `_stack`, which itself calls `pathmod.split()` repeatedly to disassemble a path. These new implementations preserve features like trailing slashes where possible, while still observing that a `..` segment cannot be added to traverse an empty or `.` segment in *walk_up* mode. They do not rely on `parents` nor `__eq__()`, nor do they spin up temporary path objects. Unfortunately calling `pathmod.relpath()` isn't an option, as it calls `abspath()` and in turn `os.getcwd()`, which is impure.
* GH-113528: Deoptimise `pathlib._abc.PurePathBase.parts` (#113883)Barney Gale2024-01-092-4/+13
| | | | | Implement `parts` using `_stack`, which itself calls `pathmod.split()` repeatedly. This avoids use of `_tail`, which will be moved to `PurePath` shortly.
* gh-66060: Use actual class name in _io type's __repr__ (#30824)AN Long2024-01-097-20/+59
| | | | | | Use the object's actual class name in the following _io type's __repr__: - FileIO - TextIOWrapper - _WindowsConsoleIO
* GH-113528: Deoptimise `pathlib._abc.PathBase.resolve()` (#113782)Barney Gale2024-01-091-25/+40
| | | | | | Replace use of `_from_parsed_parts()` with `with_segments()` in `resolve()`. No effect on `Path.resolve()`, which uses `os.path.realpath()`.
* GH-113661: unittest runner: Don't exit 5 if tests were skipped (#113856)Stefano Rivera2024-01-095-3/+18
| | | | | The intention of exiting 5 was to detect issues where the test suite wasn't discovered at all. If we skipped tests, it was correctly discovered.
* gh-113781: Silence AttributeError in warning module during Python ↵Serhiy Storchaka2024-01-092-3/+6
| | | | | | finalization (GH-113813) The tracemalloc module can already be cleared.
* gh-113848: Handle CancelledError subclasses in asyncio TaskGroup() and ↵Serhiy Storchaka2024-01-093-7/+13
| | | | timeout() (GH-113850)
* gh-113848: Use PyErr_GivenExceptionMatches() for check for CancelledError ↵Serhiy Storchaka2024-01-091-15/+1
| | | | (GH-113849)
* GH-113528: Deoptimise `pathlib._abc.PathBase._make_child_relpath()` (#113532)Barney Gale2024-01-092-14/+17
| | | | Call straight through to `joinpath()` in `PathBase._make_child_relpath()`. Move optimised/caching code to `pathlib.Path._make_child_relpath()`
* Simplify binomial approximation example with random.binomialvariate() ↵Raymond Hettinger2024-01-091-7/+4
| | | | (gh-113871)
* Fix opcode name printing in debug mode (#113870)Guido van Rossum2024-01-091-3/+3
| | | Fix a few places where the lltrace debug output printed ``(null)`` instead of an opcode name, because it was calling ``_PyUOpName()`` on a Tier-1 opcode.
* gh-113650: Add workaround option for MSVC ARM64 bug affecting string ↵Steve Dower2024-01-091-0/+2
| | | | encoding (GH-113836)
* gh-103092: Test _ctypes type hierarchy and features (#113727)AN Long2024-01-099-5/+130
| | | | | | | | | | | | | | | | | | | | | | | | | Test the following features for _ctypes types: - disallow instantiation - inheritance (MRO) - immutability - type name The following _ctypes types are tested: - Array - CField - COMError - PyCArrayType - PyCFuncPtrType - PyCPointerType - PyCSimpleType - PyCStructType - Structure - Union - UnionType - _CFuncPtr - _Pointer - _SimpleCData Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-87868: Sort and remove duplicates in getenvironment() (GH-102731)AN Long2024-01-093-4/+194
| | | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-113842: Add missing error check for PyIter_Next() in Python/symtable.c ↵Yan Yanchii2024-01-091-0/+6
| | | | (GH-113843)
* gh-101100: Fix Sphinx warnings for 2.6 port-specific deprecations (#113752)Hugo van Kemenade2024-01-092-81/+75
|
* gh-113692: skip a test if multiprocessing isn't available. (GH-113704)Vinay Sajip2024-01-091-1/+3
|
* Docs: Link tokens in the format string grammars (#108184)William Andrea2024-01-093-8/+12
| | | | Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* gh-112087: Update list.{pop,clear,reverse,remove} to use CS (gh-113764)Donghee Na2024-01-092-9/+46
|
* gh-112808: Fix mimalloc build on Solaris (#112809)Jakub Kulík2024-01-081-1/+1
|
* gh-112806: Remove unused function warnings during mimalloc build on Solaris ↵Jakub Kulík2024-01-081-2/+2
| | | | (#112807)
* readme: fix displaying issue of command (#113719)mara0042024-01-081-2/+2
| | | Avoid line break in command as this causes displaying issues on GH.
* gh-113027: Fix test_variable_tzname in test_email (#113821)Serhiy Storchaka2024-01-081-2/+2
| | | | | Determine the support of the Kyiv timezone by checking the result of astimezone() which uses the system tz database and not the one populated by zoneinfo.
* gh-113827: Move Windows frozen modules directory to allow PGO builds (GH-113828)Steve Dower2024-01-081-1/+1
|
* GH-111693: Propagate correct asyncio.CancelledError instance out of ↵Kristján Valur Jónsson2024-01-084-25/+153
| | | | | asyncio.Condition.wait() (#111694) Also fix a race condition in `asyncio.Semaphore.acquire()` when cancelled.
* gh-113791: Expose CLOCK_MONOTONIC_RAW_APPROX and CLOCK_UPTIME_RAW_APROX on ↵Ronald Oussoren2024-01-083-6/+30
| | | | | | | macOS in the time module (#113792)
* GH-113528: Speed up pathlib ABC tests. (#113788)Barney Gale2024-01-082-6/+20
| | | | | - Add `__slots__` to dummy path classes. - Return namedtuple rather than `os.stat_result` from `DummyPath.stat()`. - Reduce maximum symlink count in `DummyPathWithSymlinks.resolve()`.
* gh-113688: fix dtrace build on Solaris (#113814)Jakub Kulík2024-01-081-2/+2
| | | (the gcmodule -> gc refactoring broke it)
* GH-113528: Move a few misplaced pathlib tests (#113527)Barney Gale2024-01-082-86/+86
| | | | | | | `PurePathBase` does not define `__eq__()`, and so we have no business checking path equality in `test_eq_common` and `test_equivalences`. The tests only pass at the moment because we define the test class's `__eq__()` for use elsewhere. Also move `test_parse_path_common` into the main pathlib test suite. It exercises a private `_parse_path()` method that will be moved to `PurePath` soon. Lastly move a couple more tests concerned with optimisations and path normalisation.
* Minor algebraic simplification for the totient() recipe (gh-113822)Raymond Hettinger2024-01-081-1/+1
|
* gh-113755: Fully adapt gcmodule.c to Argument Clinic (#113756)Erlend E. Aasland2024-01-083-28/+175
| | | | | | | Adapt the following functions to Argument Clinic: - gc.set_threshold - gc.get_referrers - gc.get_referents
* gh-113787: Fix refleaks in test_capi (gh-113816)neonene2024-01-082-3/+2
| | | Fix refleaks and a typo.
* gh-113391: fix outdated PyObject_HasAttr docs (#113420)Sergey B Kirpichev2024-01-081-3/+2
| | | | | After #53875: PyObject_HasAttr is not an equivalent of hasattr. PyObject_HasAttrWithError is; it already has the note.
* gh-110721: Remove unused code from suggestions.c after moving PyErr_Display ↵Pablo Galindo Salgado2024-01-0812-225/+117
| | | | to use the traceback module (#113712)
* gh-74678: Increase base64 test coverage (GH-21913)Zackery Spytz2024-01-081-0/+3
| | | | | | Ensure the character y is disallowed within an Ascii85 5-tuple. Co-authored-by: Lee Cannon <leecannon@leecannon.xyz>
* gh-80109: Fix io.TextIOWrapper dropping the internal buffer during write() ↵Zackery Spytz2024-01-084-8/+24
| | | | | | | (GH-22535) io.TextIOWrapper was dropping the internal decoding buffer during read() and write() calls.
* gh-73965: Move PYTHON_HISTORY into the correct usage section (#113798)Hugo van Kemenade2024-01-081-1/+1
| | | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-73965: New environment variable PYTHON_HISTORY (#13208)Zackery Spytz2024-01-077-3/+50
| | | | | | | | It can be used to set the location of a .python_history file --------- Co-authored-by: Levi Sabah <0xl3vi@gmail.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-112795: Allow `/` folder in a zipfile (#112932)AN Long2024-01-073-1/+16
| | | | | | Allow extraction (no-op) of a "/" folder in a zipfile, they are commonly added by some archive creation tools. Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Gregory P. Smith <greg@krypto.org>