summaryrefslogtreecommitdiffstats
path: root/Lib/tracemalloc.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-06-03 21:57:54 (GMT)
committerGitHub <noreply@github.com>2022-06-03 21:57:54 (GMT)
commit9f101c23a41e739f5f80cf38419df1281835d452 (patch)
treee05dc572a9c2ab713dc808a1eb063964d2ae9cb6 /Lib/tracemalloc.py
parente4113be63c27faf52c5ce79f1afa3b9f6e33de46 (diff)
downloadcpython-9f101c23a41e739f5f80cf38419df1281835d452.zip
cpython-9f101c23a41e739f5f80cf38419df1281835d452.tar.gz
cpython-9f101c23a41e739f5f80cf38419df1281835d452.tar.bz2
gh-93156 - fix negative indexing into absolute `pathlib.PurePath().parents` (GH-93273)
When a `_PathParents` object has a drive or a root, the length of the object is *one less* than than the length of `self._parts`, which resulted in an off-by-one error when `path.parents[-n]` was fed through to `self._parts[:-n - 1]`. In particular, `path.parents[-1]` was a malformed path object with spooky properties. This is addressed by adding `len(self)` to negative indices. (cherry picked from commit f32e6b48d12834ba3bde01ec21c14da33abd26d6) Co-authored-by: Barney Gale <barney.gale@gmail.com>
Diffstat (limited to 'Lib/tracemalloc.py')
0 files changed, 0 insertions, 0 deletions