Merge lp:~smoser/python/lp-813295 into lp:~doko/python/pkg2.7-debian

Proposed by Scott Moser
Status: Merged
Merge reported by: Scott Moser
Merged at revision: not available
Proposed branch: lp:~smoser/python/lp-813295
Merge into: lp:~doko/python/pkg2.7-debian
Diff against target: 64 lines (+52/-0)
2 files modified
patches/issue12576.diff (+51/-0)
patches/series.in (+1/-0)
To merge this branch: bzr merge lp:~smoser/python/lp-813295
Reviewer Review Type Date Requested Status
Matthias Klose Pending
Review via email: mp+69491@code.launchpad.net

Description of the change

This pulls in the upstream commit that fixed
 - upstream issue http://bugs.python.org/issue12576
 - ubuntu bug 813295

I'm not sure if merge proposals to this branch is how you'd want things submitted or not, but here it is.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Since this was pulled from the upstream changeset, it looks fine. However, I'm going to re-open the upstream because I think the change needs to be back ported to Python 2.7.

Revision history for this message
Barry Warsaw (barry) wrote :

Never mind. The change *was* applied to 2.7, but didn't get linked in the tracker.

Revision history for this message
Barry Warsaw (barry) wrote :

Doko says in private email to go ahead and apply/upload this patch to Ubuntu now. He'll sort out the delta with Debian later.

Revision history for this message
Barry Warsaw (barry) wrote :

Oh, in case it's not clear, I'm doing that now :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'patches/issue12576.diff'
2--- patches/issue12576.diff 1970-01-01 00:00:00 +0000
3+++ patches/issue12576.diff 2011-07-27 15:52:26 +0000
4@@ -0,0 +1,51 @@
5+# DP: fix upstream issue 12576
6+
7+changeset: 71523:b66bbbdc7abd
8+branch: 2.7
9+parent: 71518:73ae3729b8fe
10+user: Senthil Kumaran <senthil@uthcode.com>
11+date: Wed Jul 27 09:37:17 2011 +0800
12+summary: merge from 3.2 - fix urlopen behavior on sites which do not send (or obsfuscates) Connection: Close header.
13+
14+diff -r 73ae3729b8fe -r b66bbbdc7abd Lib/test/test_urllib2net.py
15+--- a/Lib/test/test_urllib2net.py Tue Jul 26 18:16:08 2011 -0700
16++++ b/Lib/test/test_urllib2net.py Wed Jul 27 09:37:17 2011 +0800
17+@@ -186,6 +186,14 @@
18+ opener.open(request)
19+ self.assertEqual(request.get_header('User-agent'),'Test-Agent')
20+
21++ def test_sites_no_connection_close(self):
22++ # Some sites do not send Connection: close header.
23++ # Verify that those work properly. (#issue12576)
24++
25++ req = urllib2.urlopen('http://www.imdb.com')
26++ res = req.read()
27++ self.assertTrue(res)
28++
29+ def _test_urls(self, urls, handlers, retry=True):
30+ import time
31+ import logging
32+diff -r 73ae3729b8fe -r b66bbbdc7abd Lib/urllib2.py
33+--- a/Lib/urllib2.py Tue Jul 26 18:16:08 2011 -0700
34++++ b/Lib/urllib2.py Wed Jul 27 09:37:17 2011 +0800
35+@@ -1166,14 +1166,14 @@
36+
37+ try:
38+ h.request(req.get_method(), req.get_selector(), req.data, headers)
39++ except socket.error, err: # XXX what error?
40++ h.close()
41++ raise URLError(err)
42++ else:
43+ try:
44+ r = h.getresponse(buffering=True)
45+- except TypeError: #buffering kw not supported
46++ except TypeError: # buffering kw not supported
47+ r = h.getresponse()
48+- except socket.error, err: # XXX what error?
49+- raise URLError(err)
50+- finally:
51+- h.close()
52+
53+ # Pick apart the HTTPResponse object to get the addinfourl
54+ # object initialized properly.
55+
56
57=== modified file 'patches/series.in'
58--- patches/series.in 2011-07-09 19:39:36 +0000
59+++ patches/series.in 2011-07-27 15:52:26 +0000
60@@ -54,3 +54,4 @@
61 bsddb-libpath.diff
62 platform-linux3.diff
63 disable-sem-check.diff
64+issue12576.diff

Subscribers

People subscribed via source and target branches

to all changes: