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 e2e06f7 commit 0725bebCopy full SHA for 0725beb
1 file changed
Lib/posixpath.py
@@ -78,19 +78,18 @@ def join(a, *p):
78
path = a
79
try:
80
if not p:
81
- # bpo-23780: Ensure compatible data type even if paths is empty.
82
- a[:0] + sep
+ path[:0] + sep #23780: Ensure compatible data type even if p is null.
83
for b in map(os.fspath, p):
84
if b.startswith(sep):
85
- a = b
86
- elif not a or a.endswith(sep):
87
- a += b
+ path = b
+ elif not path or path.endswith(sep):
+ path += b
88
else:
89
- a += sep + b
+ path += sep + b
90
except (TypeError, AttributeError, BytesWarning):
91
- genericpath._check_arg_types('join', path, *p)
+ genericpath._check_arg_types('join', a, *p)
92
raise
93
- return a
+ return path
94
95
96
# Split a path in head (everything up to the last '/') and tail (the
0 commit comments