Message92180
The documentation for os.path.split says, in part:
"In nearly all cases, join(head, tail) equals path (the only
exception being when there were multiple slashes separating head
from tail)."
But this is not quite true: that's not the *only* exception, at least
without a somewhat liberal definition of "equals".
This can also happen if os.altsep is used in the path being split, in
which case it will be replaced by os.sep:
>>> import ntpath
>>> path = "a/b"
>>> (head, tail) = ntpath.split(path)
>>> joined = ntpath.join(head, tail)
>>> joined == path
False
>>> joined
'a\\b'
[I only selected the versions that I actually verified, but I would
guess it's present in more.] |
|
Date |
User |
Action |
Args |
2009-09-02 20:35:24 | evaned | set | recipients:
+ evaned, georg.brandl |
2009-09-02 20:35:24 | evaned | set | messageid: <1251923724.11.0.872695091666.issue6825@psf.upfronthosting.co.za> |
2009-09-02 20:35:21 | evaned | link | issue6825 messages |
2009-09-02 20:35:21 | evaned | create | |
|