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

Subscribers

People subscribed via source and target branches

to all changes: