#7 Add option to treat streams as binary data
Closed Opened by cheimes.

FreeIPA uses pytest_multihost's transport to transfer binary from a client back to the test machine.

It runs tar to pipe the output to stdout and then reads data on the test master. This works just fine with Python 2. However pytest_multihost wraps all streams in a TextIOWrapper in Python 3.

Please add an option to treat all streams as binary.


  • stdin hard-codes UTF-8, https://pagure.io/python-pytest-multihost/blob/master/f/pytest_multihost/transport.py#_453
  • stdout already supports encoding=None for binary encoding
  • stderr uses encoding=None to indicate binary encoding, too. I think that is wrong. The pipe thread always logs stderr https://pagure.io/python-pytest-multihost/blob/master/f/pytest_multihost/transport.py#_460 but treats stderr as text https://pagure.io/python-pytest-multihost/blob/master/f/pytest_multihost/transport.py#_485
  • BaseHost.run_command() has no option to set the encoding of stdout.
  • _end_process treats stdout as text, https://pagure.io/python-pytest-multihost/blob/master/f/pytest_multihost/transport.py#_468

See https://pagure.io/python-pytest-multihost/pull-request/11

Metadata Update from @pviktori:
- Issue status updated to: Closed (was: Open)

Metadata