Unicode double quotes on config.yaml file causes UnicodeDecodeError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Calico Charm |
New
|
Undecided
|
Unassigned |
Bug Description
I was in the process of upgrading from revision 812 to 826, when all the units went into error state due to the hook having failed.
Upon a closer look at one of the unit's logs:
2021-09-29 15:14:33 ERROR juju-log Hook error:
Traceback (most recent call last):
File "/var/lib/
hookenv.
File "/var/lib/
callback(*args, **kwargs)
File "lib/charms/
config_defs = yaml.safe_
File "/var/lib/
return load(stream, SafeLoader)
File "/var/lib/
loader = Loader(stream)
File "/var/lib/
Reader.
File "/var/lib/
self.
File "/var/lib/
self.
File "/var/lib/
data = self.stream.
File "/var/lib/
return codecs.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 292: ordinal not in range(128)
And indeed, the config.yaml file has 4 double quotes typed with the unicode char 0x201d.
The obvious workaround of replacing those quotes per "regular" ones fixed the issue.