From: Senthil Kumaran Date: Thu, 13 May 2010 03:25:21 +0000 (+0000) Subject: Fix Issue8657 - adding git and git+ssh as know schemes. X-Git-Tag: v2.7rc1~164 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81a0450cb55ac0887c8d59b5750f66aa00bd8be1;p=python Fix Issue8657 - adding git and git+ssh as know schemes. --- diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index b45fef97d0..07256a2a1e 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -103,7 +103,12 @@ class UrlParseTestCase(unittest.TestCase): ('svn+ssh', 'svn.zope.org', '/repos/main/ZConfig/trunk/', '', '', ''), ('svn+ssh', 'svn.zope.org', '/repos/main/ZConfig/trunk/', - '', '')) + '', '')), + ('git+ssh://git@github.com/user/project.git', + ('git+ssh', 'git@github.com','/user/project.git', + '','',''), + ('git+ssh', 'git@github.com','/user/project.git', + '', '')) ] for url, parsed, split in testcases: self.checkRoundtrips(url, parsed, split) diff --git a/Lib/urlparse.py b/Lib/urlparse.py index 7f3a9a4b5c..65bb9cb33a 100644 --- a/Lib/urlparse.py +++ b/Lib/urlparse.py @@ -38,7 +38,7 @@ uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'imap', uses_netloc = ['ftp', 'http', 'gopher', 'nntp', 'telnet', 'imap', 'wais', 'file', 'mms', 'https', 'shttp', 'snews', 'prospero', 'rtsp', 'rtspu', 'rsync', '', - 'svn', 'svn+ssh', 'sftp','nfs'] + 'svn', 'svn+ssh', 'sftp','nfs','git', 'git+ssh'] non_hierarchical = ['gopher', 'hdl', 'mailto', 'news', 'telnet', 'wais', 'imap', 'snews', 'sip', 'sips'] uses_params = ['ftp', 'hdl', 'prospero', 'http', 'imap',