diff options
author | Abhilash Raj <maxking@users.noreply.github.com> | 2019-10-12 16:58:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-12 16:58:11 (GMT) |
commit | 5a638a805503131f4a9cc2bbc5944611295c1500 (patch) | |
tree | 293b0ff4bda104d185dd751d2bcc0ba98047267e /Lib/test | |
parent | 1da648aceb2496c672aff82ba37ee071ac6054ac (diff) | |
download | cpython-5a638a805503131f4a9cc2bbc5944611295c1500.zip cpython-5a638a805503131f4a9cc2bbc5944611295c1500.tar.gz cpython-5a638a805503131f4a9cc2bbc5944611295c1500.tar.bz2 |
[3.8] bpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow oper parsing of URLs" (GH-16724) (GH-16728)
This reverts commit 87bd2071c756188b6cd577889fb1682831142ceb.
The reason for revert is a regression caused by the change in 3.8.0rc1, see bpo-38449 for more details.
https://bugs.python.org/issue38449
(cherry picked from commit 19a3d873005e5730eeabdc394c961e93f2ec02f0)
Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_mimetypes.py | 8 | ||||
-rw-r--r-- | Lib/test/test_urllib2.py | 2 |
2 files changed, 1 insertions, 9 deletions
diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 7761c3f..bfd5eee 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -51,14 +51,6 @@ class MimeTypesTestCase(unittest.TestCase): eq(self.db.guess_type('foo.xul', strict=False), ('text/xul', None)) eq(self.db.guess_extension('image/jpg', strict=False), '.jpg') - def test_url(self): - result = self.db.guess_type('http://host.html') - msg = 'URL only has a host name, not a file' - self.assertSequenceEqual(result, (None, None), msg) - result = self.db.guess_type('http://example.com/host.html') - msg = 'Should be text/html' - self.assertSequenceEqual(result, ('text/html', None), msg) - def test_guess_all_types(self): eq = self.assertEqual unless = self.assertTrue diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index e7e80bc..61e3ecc 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -744,7 +744,7 @@ class HandlerTests(unittest.TestCase): ["foo", "bar"], "", None), ("ftp://localhost/baz.gif;type=a", "localhost", ftplib.FTP_PORT, "", "", "A", - [], "baz.gif", "image/gif"), + [], "baz.gif", None), # XXX really this should guess image/gif ]: req = Request(url) req.timeout = None |