We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3e303f commit 9774207Copy full SHA for 9774207
tests/test_future/test_urllib2.py
@@ -691,6 +691,10 @@ def connect_ftp(self, user, passwd, host, port, dirs,
691
h = NullFTPHandler(data)
692
h.parent = MockOpener()
693
694
+ # MIME guessing works in Python 3.8!
695
+ guessed_mime = None
696
+ if sys.hexversion >= 0x03080000:
697
+ guessed_mime = "image/gif"
698
for url, host, port, user, passwd, type_, dirs, filename, mimetype in [
699
("ftp://localhost/foo/bar/baz.html",
700
"localhost", ftplib.FTP_PORT, "", "", "I",
@@ -709,7 +713,7 @@ def connect_ftp(self, user, passwd, host, port, dirs,
709
713
["foo", "bar"], "", None),
710
714
("ftp://localhost/baz.gif;type=a",
711
715
"localhost", ftplib.FTP_PORT, "", "", "A",
712
- [], "baz.gif", None), # XXX really this should guess image/gif
716
+ [], "baz.gif", guessed_mime),
717
]:
718
req = Request(url)
719
req.timeout = None
0 commit comments