From 25e2cd13885207d41344313984322b608a26fbac Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 3 Aug 2011 08:27:00 +0200 Subject: [PATCH 1/2] Fix spacing in string literal. --- Lib/http/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/http/client.py b/Lib/http/client.py index 49060079729..3f0272942ea 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -777,8 +777,8 @@ class HTTPConnection: for d in data: self.sock.sendall(d) else: - raise TypeError("data should be a bytes-like object\ - or an iterable, got %r " % type(data)) + raise TypeError("data should be a bytes-like object " + "or an iterable, got %r" % type(data)) def _output(self, s): """Add a line of output to the current request buffer. From 2a157d2a3d76960e696ef8004c237de4b424302e Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Wed, 3 Aug 2011 18:37:22 +0800 Subject: [PATCH 2/2] Fix closes issue12683 - urljoin to work with relative join of svn scheme. --- Lib/test/test_urlparse.py | 2 ++ Lib/urllib/parse.py | 3 ++- Misc/NEWS | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index 72f37769e27..af200d55e32 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -371,6 +371,8 @@ class UrlParseTestCase(unittest.TestCase): self.checkJoin('http:///', '..','http:///') self.checkJoin('', 'http://a/b/c/g?y/./x','http://a/b/c/g?y/./x') self.checkJoin('', 'http://a/./g', 'http://a/./g') + self.checkJoin('svn://pathtorepo/dir1', 'dir2', 'svn://pathtorepo/dir2') + self.checkJoin('svn://pathtorepo/dir1', 'dir2', 'svn://pathtorepo/dir2') def test_RFC2732(self): str_cases = [ diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 45ae202d5c6..01067ae6ac0 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -38,7 +38,8 @@ __all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag", # A classification of schemes ('' means apply by default) uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'imap', 'wais', 'file', 'https', 'shttp', 'mms', - 'prospero', 'rtsp', 'rtspu', '', 'sftp'] + 'prospero', 'rtsp', 'rtspu', '', 'sftp', + 'svn', 'svn+ssh'] uses_netloc = ['ftp', 'http', 'gopher', 'nntp', 'telnet', 'imap', 'wais', 'file', 'mms', 'https', 'shttp', 'snews', 'prospero', 'rtsp', 'rtspu', 'rsync', '', diff --git a/Misc/NEWS b/Misc/NEWS index e1060f6e41c..abfa83c8bde 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -41,6 +41,9 @@ Core and Builtins Library ------- +- Issue #12683: urlparse updated to include svn as schemes that uses relative + paths. (svn from 1.5 onwards support relative path). + - Issues #11104, #8688: Fix the behavior of distutils' sdist command with manually-maintained MANIFEST files.