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/os2knixpath.py

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