cpython: deb60efd32eb (original) (raw)

Mercurial > cpython

changeset 73824:deb60efd32eb

Merged fix for #13211 from 3.2 [#13211]

Jason R. Coombs jaraco@jaraco.com
date Sat, 03 Dec 2011 09:39:58 -0500
parents 51af35bd46f7(current diff)abfe76a19f63(diff)
children 9ffb00748a47
files Lib/test/test_urllib2.py Lib/urllib/error.py
diffstat 2 files changed, 17 insertions(+), 0 deletions(-)[+] [-] Lib/test/test_urllib2.py 11 Lib/urllib/error.py 6

line wrap: on

line diff

--- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1449,6 +1449,17 @@ class RequestTests(unittest.TestCase): req = Request(url) self.assertEqual(req.get_full_url(), url) +def test_HTTPError_interface():

+

+ def test_main(verbose=None): from test import test_urllib2 support.run_doctest(test_urllib2, verbose)

--- a/Lib/urllib/error.py +++ b/Lib/urllib/error.py @@ -55,6 +55,12 @@ class HTTPError(URLError, urllib.respons def str(self): return 'HTTP Error %s: %s' % (self.code, self.msg)

+

exception raised when downloaded size does not match content-length

class ContentTooShortError(URLError): def init(self, message, content):