You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Branko Čibej <br...@xbc.nu> on 2005/08/13 17:01:15 UTC

Re: svn commit: r15715 - trunk

djh@tigris.org wrote:

> +def fix_case(path):
>+    path = os.path.normpath(path)
>+    parts = string.split(path, '\\')
>+    drive = string.upper(parts[0])
>+    parts = parts[1:]
>+    path = drive + '\\'
>+    for part in parts:
>+        dirs = os.listdir(path)
>+        for dir in dirs:
>+            if string.lower(dir) == string.lower(part):
>+                path = os.path.join(path, dir)
>+                break
>+    return path
>  
>
Please don't use explicit backslashes in code like this. Use use 
os.path.split, or at least os.sep and os.altsep.

-- Brane


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org