Merge lp:~mhall119/summit/fix-lpupdate-meetings into lp:~summit-hackers/summit/1.x

Proposed by Michael Hall
Status: Merged
Approved by: Chris Johnston
Approved revision: 137
Merged at revision: 137
Proposed branch: lp:~mhall119/summit/fix-lpupdate-meetings
Merge into: lp:~summit-hackers/summit/1.x
Diff against target: 12 lines (+1/-1)
1 file modified
summit/schedule/models/meetingmodel.py (+1/-1)
To merge this branch: bzr merge lp:~mhall119/summit/fix-lpupdate-meetings
Reviewer Review Type Date Requested Status
Summit Hackers Pending
Review via email: mp+68604@code.launchpad.net

Commit message

Make simplejson read from the open URL like it's a file, not a string

Description of the change

json.loads expects to get a string (that's what the 's' in loads means). Since lpdata is an open URL handle that this point, we can treat it like a filehandle and just call json.load (no 's') on it.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'summit/schedule/models/meetingmodel.py'
2--- summit/schedule/models/meetingmodel.py 2011-07-20 17:41:32 +0000
3+++ summit/schedule/models/meetingmodel.py 2011-07-20 20:53:23 +0000
4@@ -208,7 +208,7 @@
5 try:
6 apiurl = spec_url.replace('blueprints.launchpad.net', 'api.launchpad.net/devel') + '?ws.accept=application/json'
7 lpdata = urllib2.urlopen(apiurl)
8- data = json.loads(lpdata)
9+ data = json.load(lpdata)
10 if 'title' in data:
11 self.title = data['title'][:100]
12 except (urllib2.HTTPError, KeyError):

Subscribers

People subscribed via source and target branches

to all changes: