relation_set broken under Python3

Bug #1458546 reported by Stuart Bishop
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
Fix Released
Critical
Stuart Bishop

Bug Description

Due to Juju not reporting version information, relation_set needs to sniff to see if the --file argument is available to relation-set or not. Unfortunately, the code that does this is broken under Python 3.

accepts_file = "--file" in subprocess.check_output(
        relation_cmd_line + ["--help"])

subprocess.check_output returns a byte string by default, and the 'in' operator fails. To fix this, add universal_newlines=True to the subprocess.check_output call, or decode the output using the system encoding.

Related branches

Stuart Bishop (stub)
Changed in charm-helpers:
status: New → In Progress
assignee: nobody → Stuart Bishop (stub)
importance: Undecided → Critical
Chris Glass (tribaal)
Changed in charm-helpers:
status: In Progress → Fix Committed
Stuart Bishop (stub)
Changed in charm-helpers:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.