#13 drop extra newline from stdin processing
Closed by pviktori. Opened by spoore.
spoore/python-pytest-multihost master  into  master

Download 13.patch

https://pagure.io/python-pytest-multihost/issue/12

  • Modified run_command to add -n to echo
  • added test_piping_input
  • dropped newline from assert for:
  • test_escaping
  • test_escaping_binary
  • test_background_explicit_wait
  • test_background_context

echo -e used by stdin_text processing is appending an extra
newline character to stdin. For some commands this causes
problems.

$ echo -e test|base64
dGVzdAo=

vs:

$ echo -en test|base64
dGVzdA==

and:

$ echo -en test> test_file
$ cat test_file|base64
dGVzdA==

So if stdin is a string that doesn't already contain a newline,
we shouldn't append it as extra to the end of what we pass to
the command.

Signed-off-by: Scott Poore spoore@redhat.com

@slaykovsky @pviktori

Can you guys take a look at this? Will this break anything or can we merge this in?

Thanks

Technically speaking it is a breaking change. I'll bump major version. I'll get to it today or Monday.

Do we know if it will directly break something where @slaykovsky needed the encoding fixes and stdin changes?

No, but I think this is a genuine fix. If it breaks something, I would – with apologies to the affected people – rather see the calling code change.

ACK, merged. Thank you!

Pull-Request has been closed by pviktori

Released in 3.0, including packages for Fedora rawhide and F28.
Please test, and let me know if something is missing.

Metadata