Merge ~kissiel/checkbox-support:snap_utils into checkbox-support:master
Status: | Merged |
---|---|
Approved by: | Sylvain Pineau |
Approved revision: | 3b54b23b43bcffcad2a61a43f6e8483499f472fe |
Merged at revision: | 03f2d1d8b88b16dcdb6e9de628d1ae88e18254d2 |
Proposed branch: | ~kissiel/checkbox-support:snap_utils |
Merge into: | checkbox-support:master |
Diff against target: |
13 lines (+1/-1) 1 file modified
checkbox_support/snap_utils/config.py (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sylvain Pineau (community) | Approve | ||
Review via email: mp+333875@code.launchpad.net |
Description of the change
snap_utils: ensure values are stringified
if the value stored by the snapd is a string with only numbers in it, later on it gets printed in the json as number making python instantiate an Int from it.
Python's configparser expects only string, so this patch ensures the values are always treated as strings.
To test it, try setting any value to a number, and afterwards setting anything, like so:
$ sudo checkbox-
$ sudo checkbox-
Traceback (most recent call last):
File "/snap/
main()
File "/snap/
update_
File "/snap/
get_
File "/snap/
config.
File "/snap/
self.
File "/snap/
raise TypeError("option values must be strings")
TypeError: option values must be strings
With this patch there should be no crash.
Good catch, +1