Merge lp:~jelmer/bzr/readline-size into lp:bzr

Proposed by Jelmer Vernooij
Status: Rejected
Rejected by: Vincent Ladeuil
Proposed branch: lp:~jelmer/bzr/readline-size
Merge into: lp:bzr
Diff against target: 32 lines (+5/-7)
2 files modified
bzrlib/transport/http/_urllib2_wrappers.py (+2/-7)
doc/en/release-notes/bzr-2.3.txt (+3/-0)
To merge this branch: bzr merge lp:~jelmer/bzr/readline-size
Reviewer Review Type Date Requested Status
Vincent Ladeuil Needs Fixing
Martin Packman (community) Needs Fixing
Review via email: mp+44612@code.launchpad.net

Description of the change

This adds a size argument to _ReportingFileSocket.readline().

This fixes the use of http on Python 2.7. I haven't checked on Python 2.4 and 2.5 yet, we might have to add some conditionals. :-/

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

It seems pretty clear from vila's comment that you deleted that merging this will break 2.4 and 2.5 so...

review: Needs Fixing
Revision history for this message
Vincent Ladeuil (vila) wrote :

Well, I thought the comment was clear enough that we *can't* do what your propose or break python2.[45] compatibility.

So we *need* conditionals.

What is more disturbing though, is that we don't have a test failing for python2.7...

Revision history for this message
Vincent Ladeuil (vila) wrote :

Grrr *vote* damn it *vote* ! Comments implying NeedsFixing without spelling it out are sooo annoying !

<cough> sorry, ranting against myself here, but still :)

review: Needs Fixing
Revision history for this message
Vincent Ladeuil (vila) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/transport/http/_urllib2_wrappers.py'
2--- bzrlib/transport/http/_urllib2_wrappers.py 2010-10-18 10:01:47 +0000
3+++ bzrlib/transport/http/_urllib2_wrappers.py 2010-12-23 19:36:17 +0000
4@@ -110,13 +110,8 @@
5 self.report_activity(len(s), 'read')
6 return s
7
8- def readline(self):
9- # This should be readline(self, size=-1), but httplib in python 2.4 and
10- # 2.5 defines a SSLFile wrapper whose readline method lacks the size
11- # parameter. So until we drop support for 2.4 and 2.5 and since we
12- # don't *need* the size parameter we'll stay with readline(self)
13- # -- vila 20090209
14- s = self.filesock.readline()
15+ def readline(self, size=-1):
16+ s = self.filesock.readline(size)
17 self.report_activity(len(s), 'read')
18 return s
19
20
21=== modified file 'doc/en/release-notes/bzr-2.3.txt'
22--- doc/en/release-notes/bzr-2.3.txt 2010-12-21 10:12:37 +0000
23+++ doc/en/release-notes/bzr-2.3.txt 2010-12-23 19:36:17 +0000
24@@ -55,6 +55,9 @@
25 .. Fixes for situations where bzr would previously crash or give incorrect
26 or undesirable results.
27
28+* _ReportingFileSocket.readline() now accepts a size argument. This fixes
29+ http access on Python2.7. (Jelmer Vernooij, #693880)
30+
31 Documentation
32 *************
33