summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2005-07-29 15:56:32 (GMT)
committerFred Drake <fdrake@acm.org>2005-07-29 15:56:32 (GMT)
commit50747fc1b9985e857ef6138bcb9b24257aefc949 (patch)
tree1644a6b08d4ccfecb83c83417adbaf537db9daff
parentc320c22f79b8f5af7d3fe4e05b1ea6eaf15a4c8b (diff)
downloadcpython-50747fc1b9985e857ef6138bcb9b24257aefc949.zip
cpython-50747fc1b9985e857ef6138bcb9b24257aefc949.tar.gz
cpython-50747fc1b9985e857ef6138bcb9b24257aefc949.tar.bz2
add support for svn: and svn+ssh: URL schemes to urlparse
-rw-r--r--Lib/test/test_urlparse.py5
-rw-r--r--Lib/urlparse.py3
2 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index 04572ba..39ada06 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -35,6 +35,11 @@ class UrlParseTestCase(unittest.TestCase):
'', '', ''),
('mms', 'wms.sys.hinet.net', '/cts/Drama/09006251100.asf',
'', '')),
+ ('svn+ssh://svn.zope.org/repos/main/ZConfig/trunk/',
+ ('svn+ssh', 'svn.zope.org', '/repos/main/ZConfig/trunk/',
+ '', '', ''),
+ ('svn+ssh', 'svn.zope.org', '/repos/main/ZConfig/trunk/',
+ '', ''))
]
for url, parsed, split in testcases:
self.checkRoundtrips(url, parsed, split)
diff --git a/Lib/urlparse.py b/Lib/urlparse.py
index 8469139..c7c77e3 100644
--- a/Lib/urlparse.py
+++ b/Lib/urlparse.py
@@ -13,7 +13,8 @@ uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'imap',
'prospero', 'rtsp', 'rtspu', '']
uses_netloc = ['ftp', 'http', 'gopher', 'nntp', 'telnet',
'imap', 'wais', 'file', 'mms', 'https', 'shttp',
- 'snews', 'prospero', 'rtsp', 'rtspu', 'rsync', '']
+ 'snews', 'prospero', 'rtsp', 'rtspu', 'rsync', '',
+ 'svn', 'svn+ssh']
non_hierarchical = ['gopher', 'hdl', 'mailto', 'news',
'telnet', 'wais', 'imap', 'snews', 'sip']
uses_params = ['ftp', 'hdl', 'prospero', 'http', 'imap',