cpython: fbea8ff8db5e (original) (raw)

Mercurial > cpython

changeset 99772:fbea8ff8db5e 2.7

Issue #6500: Fix "maximum recursion depth exceeded" error caused by Request.__getattr__() [#6500]

Berker Peksag berker.peksag@gmail.com
date Wed, 06 Jan 2016 02:04:52 +0200
parents f2a846c1b593
children e2faa18802bb
files Lib/test/test_urllib2.py Lib/urllib2.py Misc/NEWS
diffstat 3 files changed, 11 insertions(+), 2 deletions(-)[+] [-] Lib/test/test_urllib2.py 7 Lib/urllib2.py 3 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1302,6 +1302,13 @@ class RequestTests(unittest.TestCase): self.assertEqual("POST", self.post.get_method()) self.assertEqual("GET", self.get.get_method())

+ def test_add_data(self): self.assertTrue(not self.get.has_data()) self.assertEqual("GET", self.get.get_method())

--- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -251,8 +251,7 @@ class Request: if attr[:12] == 'Request__r': name = attr[12:] if hasattr(Request, 'get_' + name):

def get_method(self):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -36,6 +36,9 @@ Core and Builtins Library ------- +- Issue #6500: Fix "maximum recursion depth exceeded" error caused