if proxies is not None:
opener = urllib.request.FancyURLopener(proxies=proxies)
elif not _urlopener:
- opener = urllib.request.FancyURLopener()
+ with support.check_warnings(
+ ('FancyURLopener style of invoking requests is deprecated.',
+ DeprecationWarning)):
+ opener = urllib.request.FancyURLopener()
_urlopener = opener
else:
opener = _urlopener
class DummyURLopener(urllib.request.URLopener):
def open_spam(self, url):
return url
-
- self.assertEqual(DummyURLopener().open(
- 'spam://example/ /'),'//example/%20/')
-
- # test the safe characters are not quoted by urlopen
- self.assertEqual(DummyURLopener().open(
- "spam://c:|windows%/:=&?~#+!$,;'@()*[]|/path/"),
- "//c:|windows%/:=&?~#+!$,;'@()*[]|/path/")
+ with support.check_warnings(
+ ('DummyURLopener style of invoking requests is deprecated.',
+ DeprecationWarning)):
+ self.assertEqual(DummyURLopener().open(
+ 'spam://example/ /'),'//example/%20/')
+
+ # test the safe characters are not quoted by urlopen
+ self.assertEqual(DummyURLopener().open(
+ "spam://c:|windows%/:=&?~#+!$,;'@()*[]|/path/"),
+ "//c:|windows%/:=&?~#+!$,;'@()*[]|/path/")
# Just commented them out.
# Can't really tell why keep failing in windows and sparc.