Ignore:
Timestamp:
Dec 11, 2015, 7:20:33 PM (10 years ago)
Author:
dmik
Message:

python: Replace altsep to sep in paths returned by os.path.join.

This makes the returned paths consistent and fixes failures in situations
where the result is further passed to a unix shell (and similar cases).
See #148 for more details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/trunk/Lib/os2emxpath.py

    r381 r607  
    3737
    3838    Makes all characters lowercase and all altseps into seps."""
    39     return s.replace('\\', '/').lower()
     39    return s.replace(altsep, sep).lower()
    4040
    4141
     
    4444def join(a, *p):
    4545    """Join two or more pathname components, inserting sep as needed"""
     46
     47    Also replace all altsep chars with sep in the returned string
     48    to make it consistent."""
    4649    path = a
    4750    for b in p:
     
    5255        else:
    5356            path = path + '/' + b
    54     return path
     57    return path.replace(altsep, sep)
    5558
    5659
Note: See TracChangeset for help on using the changeset viewer.