Merge lp:~javier.collado/checkbox-core/bug991875 into lp:checkbox-core

Proposed by Javier Collado
Status: Merged
Merged at revision: 21
Proposed branch: lp:~javier.collado/checkbox-core/bug991875
Merge into: lp:checkbox-core
Diff against target: 16 lines (+4/-2)
1 file modified
checkbox/process/info.py (+4/-2)
To merge this branch: bzr merge lp:~javier.collado/checkbox-core/bug991875
Reviewer Review Type Date Requested Status
Marc Tardif Approve
Review via email: mp+104091@code.launchpad.net

Description of the change

Added check to make sure that entry.split("=", 1) works
when /proc/*/environ format isn't the expected one.

To post a comment you must log in.
Revision history for this message
Marc Tardif (cr3) wrote :

Good catch, merging!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox/process/info.py'
2--- checkbox/process/info.py 2012-04-23 19:36:19 +0000
3+++ checkbox/process/info.py 2012-04-30 11:20:37 +0000
4@@ -183,8 +183,10 @@
5 pass
6 else:
7 # Convert NUL delimited strings to the usual format
8- env_entries = env_buffer.split("\0")
9- env = dict((entry.split("=", 1)) for entry in env_entries if entry)
10+ env_entries = [entry.split("=", 1)
11+ for entry in env_buffer.split("\0") if entry]
12+ env = dict(env_entry
13+ for env_entry in env_entries if len(env_entry) == 2)
14
15 # Filter and insert into pid environment table
16 info.pid_env_id.filter_and_insert(env)

Subscribers

People subscribed via source and target branches

to all changes: