diff options
| author | Mark Hammond <mhammond@skippinet.com.au> | 2001-05-13 08:04:26 (GMT) | 
|---|---|---|
| committer | Mark Hammond <mhammond@skippinet.com.au> | 2001-05-13 08:04:26 (GMT) | 
| commit | ef8b654bbea15dc55767a7095e01dff7a3ca86cb (patch) | |
| tree | 778653b95245ae2d31e5a5ed94c0c491e1687b15 /Lib/ntpath.py | |
| parent | 342c65e19ac0cc47bf2b21026c76e63440b23748 (diff) | |
| download | cpython-ef8b654bbea15dc55767a7095e01dff7a3ca86cb.zip cpython-ef8b654bbea15dc55767a7095e01dff7a3ca86cb.tar.gz cpython-ef8b654bbea15dc55767a7095e01dff7a3ca86cb.tar.bz2  | |
Add support for Windows using "mbcs" as the default Unicode encoding when dealing with the file system.  As discussed on python-dev and in patch 410465.
Diffstat (limited to 'Lib/ntpath.py')
| -rw-r--r-- | Lib/ntpath.py | 17 | 
1 files changed, 4 insertions, 13 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 63860ce7..47c1acf 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -404,21 +404,12 @@ def normpath(path):  # Return an absolute path.  def abspath(path):      """Return the absolute version of a path""" -    try: -        import win32api -    except ImportError: -        global abspath -        def _abspath(path): -            if not isabs(path): -                path = join(os.getcwd(), path) -            return normpath(path) -        abspath = _abspath -        return _abspath(path)      if path: # Empty path must return current working directory. +        from nt import _getfullpathname          try: -            path = win32api.GetFullPathName(path) -        except win32api.error: -            pass # Bad path - return unchanged. +            path = _getfullpathname(path) +        except WindowsError: +                pass # Bad path - return unchanged.      else:          path = os.getcwd()      return normpath(path)  | 
