10000 gh-117352: Handle `/:/` for `ntpath.isabs` by nineteendo · Pull Request #117362 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-117352: Handle /:/ for ntpath.isabs #117362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify check
Co-Authored-By: Barney Gale <barney.gale@gmail.com>
  • Loading branch information
nineteendo and barneygale committed Mar 30, 2024
commit 2950921bc2f1dcaf73e8ad3711dd4b353136e440
8 changes: 4 additions & 4 deletions Lib/ntpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ def isabs(s):
sep = b'\\'
altsep = b'/'
colon_sep = b':\\'
double_sep = b'\\\\'
else:
sep = '\\'
altsep = '/'
colon_sep = ':\\'
double_sep = '\\\\'
s = s[:3].replace(altsep, sep)
# Absolute: UNC, device, and paths with a drive and root.
return (s[1:3] == colon_sep and s[:1] != sep) or s[:2] == double_sep

if s[:1] == sep:
return s[1:2] == sep
else:
return s[1:3] == colon_sep

# Join two (or more) paths.
def join(path, *paths):
Expand Down
0