8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d42ac9 commit f90ff03Copy full SHA for f90ff03
Lib/ntpath.py
@@ -368,13 +368,15 @@ def expanduser(path):
368
If user or $HOME is unknown, do nothing."""
369
path = os.fspath(path)
370
if isinstance(path, bytes):
371
+ seps = b'\\/'
372
tilde = b'~'
373
else:
374
+ seps = '\\/'
375
tilde = '~'
376
if not path.startswith(tilde):
377
return path
378
i, n = 1, len(path)
- while i < n and path[i] not in _get_bothseps(path):
379
+ while i < n and path[i] not in seps:
380
i += 1
381
382
if 'USERPROFILE' in os.environ:
Misc/NEWS.d/3.13.0a6.rst
@@ -4,7 +4,7 @@
4
.. release date: 2024-04-09
5
.. section: Core and Builtins
6
7
-Improve performance of :func:`os.path.join`.
+Improve performance of :func:`os.path.join` and :func:`os.path.expanduser`.
8
9
..
10
0 commit comments