Merge ~jocave/checkbox-ng:explict-bytes-decode into checkbox-ng:master

Proposed by Jonathan Cave
Status: Merged
Approved by: Jonathan Cave
Approved revision: f2dc2be5e64aa2810a2409080c63c85515493a2e
Merged at revision: 57940dc6b1583b3180d5136670ec9a2a36e073f8
Proposed branch: ~jocave/checkbox-ng:explict-bytes-decode
Merge into: checkbox-ng:master
Diff against target: 15 lines (+2/-2)
1 file modified
plainbox/impl/session/assistant.py (+2/-2)
Reviewer Review Type Date Requested Status
Maciej Kisielewski Approve
Review via email: mp+362140@code.launchpad.net

Description of the change

Fix a crash noticed on havasu with recent change to app_blob updating. The update was relying on a call to the default decoder rather than being explicit about using UTF-8.

Tested on the device in the lab.

To post a comment you must log in.
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/plainbox/impl/session/assistant.py b/plainbox/impl/session/assistant.py
2index 0b130bb..1f67655 100644
3--- a/plainbox/impl/session/assistant.py
4+++ b/plainbox/impl/session/assistant.py
5@@ -741,8 +741,8 @@ class SessionAssistant:
6 if self._context.state.metadata.app_blob == b'':
7 updated_blob = app_blob
8 else:
9- current_dict = json.loads(self._context.state.metadata.app_blob)
10- current_dict.update(json.loads(app_blob))
11+ current_dict = json.loads(self._context.state.metadata.app_blob.decode('UTF-8'))
12+ current_dict.update(json.loads(app_blob.decode('UTF-8')))
13 updated_blob = json.dumps(current_dict).encode('UTF-8')
14 self._context.state.metadata.app_blob = updated_blob
15 self._manager.checkpoint()

Subscribers

People subscribed via source and target branches