python3.5 subprocess.check_output() doesn't support encoding argument
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Graylog Charm |
Fix Released
|
Undecided
|
Unassigned | ||
Snap Layer |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The command 'juju deploy cs:graylog-39 --config channel=3/stable --series xenial graylog2' will produce the following errors.
File "/var/lib/
cur_snap = new_snap = snap.get_
File "lib/charms/
return subprocess.
File "/usr/lib/
**kwargs).stdout
File "/usr/lib/
with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'encoding'
but the command 'juju deploy cs:graylog-39 --config channel=3/stable --series bionic graylog' won't.
xenial uses python3.5 as default, while bionic uses python3.6 as default.
and I found the function check_output doesn't have the encoding argument in python3.5 according to the doc [1].
So after changing L256 of /var/lib/
from
return subprocess.
'installed:
to
return subprocess.
'installed:
and above change can also run well in python3.6, so I think we should make this change to be compatible with python3.5 and python3.6 at the same time.
Related branches
- Stuart Bishop: Approve
-
Diff: 20 lines (+2/-2)1 file modifiedlib/charms/layer/snap.py (+2/-2)
description: | updated |
tags: | added: sts |
Changed in layer-snap: | |
status: | New → In Progress |
Changed in layer-snap: | |
status: | In Progress → Fix Released |
Changed in graylog-charm: | |
status: | New → Fix Released |
Confirmed fixed in graylog/40