Commits

Anonymous committed 819a136

use cygpath -m program to do path conversions because it's robust on Windows whether you're converting to or from python.

Comments (0)

Files changed (1)

rope/base/project.py

     Is equivalent to ``realpath(abspath(expanduser(path)))``.
 
     """
-    # there is a bug in cygwin for os.path.abspath() for abs paths
     if sys.platform == 'cygwin':
-        if path[1:3] == ':\\' or path[1:3] == ':/':
-            return path
-        else:
-            return os.path.expanduser(path)
+        # cygpath -m returns windows drive letters but with forward slashes.
+        # Python likes these paths, unlike some other cygwin programs
+        from subprocess import Popen, PIPE
+        return Popen("cygpath -m " + path, shell=True, stdout=PIPE).stdout.read().rstrip('\n')
     return os.path.realpath(os.path.abspath(os.path.expanduser(path)))