[Python-checkins] r74470 - python/branches/release31-maint/Lib/macurl2path.py

senthil.kumaran python-checkins at python.org
Sun Aug 16 08:44:28 CEST 2009


Author: senthil.kumaran
Date: Sun Aug 16 08:44:28 2009
New Revision: 74470

Log:
Fixing Issue6711 - macurl2path has typos that raise AttributeError



Modified:
   python/branches/release31-maint/Lib/macurl2path.py

Modified: python/branches/release31-maint/Lib/macurl2path.py
==============================================================================
--- python/branches/release31-maint/Lib/macurl2path.py	(original)
+++ python/branches/release31-maint/Lib/macurl2path.py	Sun Aug 16 08:44:28 2009
@@ -13,7 +13,7 @@
     #
     # XXXX The .. handling should be fixed...
     #
-    tp = urllib.parsesplittype(pathname)[0]
+    tp = urllib.parse.splittype(pathname)[0]
     if tp and tp != 'file':
         raise RuntimeError('Cannot convert non-local URL to pathname')
     # Turn starting /// into /, an empty hostname means current host
@@ -47,7 +47,7 @@
             i = i + 1
         rv = ':' + ':'.join(components)
     # and finally unquote slashes and other funny characters
-    return urllib.parseunquote(rv)
+    return urllib.parse.unquote(rv)
 
 def pathname2url(pathname):
     """OS-specific conversion from a file system path to a relative URL
@@ -74,7 +74,7 @@
 
 def _pncomp2url(component):
     # We want to quote slashes
-    return urllib.parsequote(component[:31], safe='')
+    return urllib.parse.quote(component[:31], safe='')
 
 def test():
     for url in ["index.html",


More information about the Python-checkins mailing list