cron_ipmi_sensors.py: TypeError: write() argument must be str, not bytes
Bug #1879603 reported by
Joe Guo
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
hw-health-charm |
Fix Released
|
Critical
|
Unassigned |
Bug Description
After `juju upgrade-charm --switch cs:hw-health-0 hw-health`, I found following exception:
/usr/local/
Traceback (most recent call last):
File "/usr/local/
File "/usr/local/
TypeError: write() argument must be str, not bytes
Related branches
charm-hw-health:str-bytes-conversion
Rejected
for merging
into
charm-hw-health:stable/20.05
- Paul Goins: Approve
- Zachary Zehring (community): Approve
-
Diff: 19 lines (+1/-2)1 file modifiedsrc/files/ipmi/cron_ipmi_sensors.py (+1/-2)
charm-hw-health:str-bytes-conversion
- Alvaro Uria (community): Approve
- Xav Paice (community): Approve
-
Diff: 19 lines (+1/-2)1 file modifiedsrc/files/ipmi/cron_ipmi_sensors.py (+1/-2)
description: | updated |
Changed in charm-hw-health: | |
assignee: | nobody → Joe Guo (guoqiao) |
importance: | Undecided → Medium |
milestone: | none → 20.05 |
Changed in charm-hw-health: | |
milestone: | 20.05 → none |
Changed in charm-hw-health: | |
status: | New → In Progress |
Changed in charm-hw-health: | |
importance: | Medium → Critical |
Changed in charm-hw-health: | |
assignee: | Joe Guo (guoqiao) → Andrea Ieri (aieri) |
To post a comment you must log in.
In py2: open with `w` == `wb` check_output always return bytes, in both py2/py3.
In py3: `w` == `wt`
However, subprocess.
So in py3, while trying to write output (bytes) to file opened with `w` (`wt`, expect text), it will raise error.
Merge created to fix this bug.