New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test-driver.py: remove bufsize=1 from Popen calls #101538
Conversation
Looks good, thank you. I don't feel good merging this without having the bot posting success on a few test runs here. Can you start some test runs on this? |
@ofborg test bittorrent installer |
@xfix can you please have a look why the tests.installer test failed on aarch64 linux? |
It failed because there is no test called @ofborg test bittorrent installer.simple acme |
Oh right, I need to rebase newest master to fix tests because of bc2188b. |
According to Python documentation [0], `bufsize=1` is only meaningful in text mode. As we don't pass in an argument called `universal_newlines`, `encoding`, `errors` or `text` the file objects aren't opened in text mode, which means the argument is ignored with a warning in Python 3.8. line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used This commit removes this warning that appared when using interactive test driver built with `-A driver`. This is done by removing `bufsize=1` from Popen calls. The default parameter when unspecified for `bufsize` is `-1` which according to the documentation will be interpreted as `io.DEFAULT_BUFFER_SIZE`. As mentioned by a warning, Python already uses default buffer size when providing `buffering=1` parameter for file objects not opened in text mode. [0]: https://docs.python.org/3/library/subprocess.html#subprocess.Popen
526b166
to
254d30d
Compare
@ofborg test bittorrent installer.simple acme |
Okay, I think this may have been caused by bc2188b actually. |
Okay installer.simple may be fixed by #101645, this isn't related to this pull request. |
According to Python documentation,
bufsize=1
is only meaningful in text mode. As we don't pass in an argument calleduniversal_newlines
,encoding
,errors
ortext
the file objects aren't opened in text mode, which means the argument is ignored with a warning in Python 3.8.This commit removes this warning that appared when using interactive test driver built with
-A driver
. This is done by removingbufsize=1
from Popen calls.The default parameter when unspecified for
bufsize
is-1
which according to the documentation will be interpreted asio.DEFAULT_BUFFER_SIZE
. As mentioned by a warning, Python already uses default buffer size when providingbuffering=1
parameter for file objects not opened in text mode.Motivation for this change
Fixing a warning.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)