Skip to content

Commit 734f059

Browse files
committed
Merged revisions 78268 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
1 parent a11865b commit 734f059

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Lib/test/test_urllib.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def test_iter(self):
112112
for line in self.returned_obj.__iter__():
113113
self.assertEqual(line, self.text)
114114

115-
116115
class ProxyTests(unittest.TestCase):
117116

118117
def setUp(self):
@@ -866,6 +865,11 @@ def open_spam(self, url):
866865
self.assertEqual(DummyURLopener().open(
867866
'spam://example/ /'),'//example/%20/')
868867

868+
# test the safe characters are not quoted by urlopen
869+
self.assertEqual(DummyURLopener().open(
870+
"spam://c:|windows%/:=&?~#+!$,;'@()*[]|/path/"),
871+
"//c:|windows%/:=&?~#+!$,;'@()*[]|/path/")
872+
869873
# Just commented them out.
870874
# Can't really tell why keep failing in windows and sparc.
871875
# Everywhere else they work ok, but on those machines, someteimes

Lib/urllib/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ def addheader(self, *args):
14261426
def open(self, fullurl, data=None):
14271427
"""Use URLopener().open(file) instead of open(file, 'r')."""
14281428
fullurl = unwrap(to_bytes(fullurl))
1429-
fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]")
1429+
fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]|")
14301430
if self.tempcache and fullurl in self.tempcache:
14311431
filename, headers = self.tempcache[fullurl]
14321432
fp = open(filename, 'rb')

0 commit comments

Comments
 (0)