Merge lp:~xnox/ubuntu/raring/thin-client-config-agent/fix-1152222 into lp:ubuntu/raring/thin-client-config-agent

Proposed by Dimitri John Ledkov
Status: Merged
Merge reported by: Dimitri John Ledkov
Merged at revision: not available
Proposed branch: lp:~xnox/ubuntu/raring/thin-client-config-agent/fix-1152222
Merge into: lp:ubuntu/raring/thin-client-config-agent
Diff against target: 23 lines (+3/-3)
1 file modified
tccalib/__init__.py (+3/-3)
To merge this branch: bzr merge lp:~xnox/ubuntu/raring/thin-client-config-agent/fix-1152222
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Approve
Michael Terry Approve
Barry Warsaw (community) Approve
David Barth Pending
Ubuntu branches Pending
Review via email: mp+156801@code.launchpad.net

Description of the change

Not sure where the "upstream" of thin-client-config-agent is, but I'm merely proposing a merge to fix bug #1152222 , which looks like a change in PyCurl API since quantal. But IMHO pycurl is now more correct: bytes are passed over the wire, and one must encode/decode before sending & receiving data. Alternatively it's a bug in PyCurl since it stopped accepting utf-8 strings.

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

Looks reasonable to me.

review: Approve
Revision history for this message
Michael Terry (mterry) wrote :

Seems fine.

review: Approve
Revision history for this message
David Barth (dbarth) wrote :

Please see https://code.launchpad.net/~dbarth/ubuntu/raring/thin-client-config-agent/further-fix-1152222 which ensure the whole test suite passes. I think that this is the one xnox will end up merging.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tccalib/__init__.py'
2--- tccalib/__init__.py 2012-08-15 21:46:51 +0000
3+++ tccalib/__init__.py 2013-04-03 10:40:33 +0000
4@@ -70,8 +70,8 @@
5 if _curl is None:
6 _curl = pycurl.Curl()
7 self.curl = _curl
8- self.result = StringIO()
9- self.response_header = StringIO()
10+ self.result = BytesIO()
11+ self.response_header = BytesIO()
12 self.curl.setopt(pycurl.HEADERFUNCTION, self.response_header.write)
13 self.curl.setopt(pycurl.WRITEFUNCTION, self.result.write)
14 self.verify_ssl = True
15@@ -127,7 +127,7 @@
16 if status == 200:
17 return self.result.getvalue()
18 else:
19- lines = self.response_header.getvalue().splitlines(True)
20+ lines = self.response_header.getvalue().decode('utf-8').splitlines(True)
21 header_ = ''.join(lines[1:])
22 headers = parse_headers(BytesIO(header_.encode('ascii')))
23 raise urllib.error.HTTPError(

Subscribers

People subscribed via source and target branches