output to file fails under Python3

Bug #1673693 reported by Pavlo Shchelokovskyy
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
subunit
Fix Released
Undecided
Unassigned

Bug Description

I was trying to produce jUnit xml out of subunit stream.

Running "subunit2junitxml -o output.xml" with Python 3.5 (Ubuntu Xenial) fails with this traceback:

Traceback (most recent call last):
  File "/home/pshchelo/git/openstack/ironic-python-heartbeater/.tox/py35/bin/subunit2junitxml", line 36, in <module>
    protocol_version=2)
  File "/home/pshchelo/git/openstack/ironic-python-heartbeater/.tox/py35/lib/python3.5/site-packages/subunit/filters.py", line 183, in run_filter_script
    input_stream=find_stream(sys.stdin, args))
  File "/home/pshchelo/git/openstack/ironic-python-heartbeater/.tox/py35/lib/python3.5/site-packages/subunit/filters.py", line 146, in filter_by_result
    output_to = file(output_path, 'wb')
NameError: name 'file' is not defined

which is due to 'file' type was removed from Python3.

I suspect any other scripts that can write output to file are affected as well.

Obvious workaround is to use stdout to file redirection, but I still think it should be fixed since Python3 support is claimed in trove specifier.

Jelmer Vernooij (jelmer)
Changed in subunit:
status: New → 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.