| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Use cursive to make it looking like mathematic formulas.
|
|
|
| |
It occurred when try to re-encode an unknown-8bit part combined with non-unknown-8bit part.
|
|
|
|
|
| |
(GH-113786)
Based on patch by SilentGhost.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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__`
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
(#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.
|
|
|
|
|
| |
Implement `parts` using `_stack`, which itself calls `pathmod.split()`
repeatedly. This avoids use of `_tail`, which will be moved to `PurePath`
shortly.
|
|
|
|
|
|
| |
Use the object's actual class name in the following _io type's __repr__:
- FileIO
- TextIOWrapper
- _WindowsConsoleIO
|
|
|
|
|
|
| |
Replace use of `_from_parsed_parts()` with `with_segments()` in
`resolve()`.
No effect on `Path.resolve()`, which uses `os.path.realpath()`.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
finalization (GH-113813)
The tracemalloc module can already be cleared.
|
|
|
|
| |
timeout() (GH-113850)
|
|
|
|
| |
(GH-113849)
|
|
|
|
| |
Call straight through to `joinpath()` in `PathBase._make_child_relpath()`.
Move optimised/caching code to `pathlib.Path._make_child_relpath()`
|
|
|
|
| |
(gh-113871)
|
|
|
| |
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.
|
|
|
|
| |
encoding (GH-113836)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
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-113843)
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
| |
|
| |
|
|
|
|
| |
(#112807)
|
|
|
| |
Avoid line break in command as this causes displaying issues on GH.
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
asyncio.Condition.wait() (#111694)
Also fix a race condition in `asyncio.Semaphore.acquire()` when cancelled.
|
|
|
|
|
|
|
| |
macOS in the time module (#113792)
|
|
|
|
|
| |
- Add `__slots__` to dummy path classes.
- Return namedtuple rather than `os.stat_result` from `DummyPath.stat()`.
- Reduce maximum symlink count in `DummyPathWithSymlinks.resolve()`.
|
|
|
| |
(the gcmodule -> gc refactoring broke it)
|
|
|
|
|
|
|
| |
`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.
|
| |
|
|
|
|
|
|
|
| |
Adapt the following functions to Argument Clinic:
- gc.set_threshold
- gc.get_referrers
- gc.get_referents
|
|
|
| |
Fix refleaks and a typo.
|
|
|
|
|
| |
After #53875: PyObject_HasAttr is not an equivalent of hasattr.
PyObject_HasAttrWithError is; it already has the note.
|
|
|
|
| |
to use the traceback module (#113712)
|
|
|
|
|
|
| |
Ensure the character y is disallowed within an Ascii85 5-tuple.
Co-authored-by: Lee Cannon <leecannon@leecannon.xyz>
|
|
|
|
|
|
|
| |
(GH-22535)
io.TextIOWrapper was dropping the internal decoding buffer
during read() and write() calls.
|
|
|
|
| |
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|