Skip to content
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

RuntimeWarning with respect to line buffering using Python 3.8. #12

Open
mjstahlberg opened this issue Jul 7, 2020 · 10 comments · May be fixed by #14
Open

RuntimeWarning with respect to line buffering using Python 3.8. #12

mjstahlberg opened this issue Jul 7, 2020 · 10 comments · May be fixed by #14

Comments

@mjstahlberg
Copy link

I'm getting the following warning using Python 3.8.3 and concurrencytest 0.1.2:

Traceback (most recent call last):
  File "./test.py", line 191, in <module>
    result   = testRunner.run(testSuite)
  File "/usr/lib/python3.8/unittest/runner.py", line 176, in run
    test(result)
  File "/usr/lib/python3.8/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python3.8/site-packages/testtools/testsuite.py", line 83, in run
    tests = self.make_tests(self)
  File "/usr/lib/python3.8/site-packages/concurrencytest.py", line 96, in do_fork
    stream = os.fdopen(c2pread, 'rb', 1)
  File "/usr/lib/python3.8/os.py", line 1023, in fdopen
    return io.open(fd, *args, **kwargs)
RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
@alan23273850
Copy link

I also have this special kind of warning even if other warnings are suppressed !!!

@aaronlelevier
Copy link

The warnings library can suppress all warnings:

import warnings

with warnings.catch_warnings():
    warnings.simplefilter("ignore")
    # invoke test suite

@mjstahlberg
Copy link
Author

That workaround silences other warnings as well which can be problematic especially in a testing environment.

mjstahlberg added a commit to mjstahlberg/concurrencytest that referenced this issue Jan 13, 2021
@mjstahlberg mjstahlberg linked a pull request Jan 13, 2021 that will close this issue
@mariusbalcytis
Copy link

This specific one can be suppressed using the following:

import warnings

warnings.filterwarnings('ignore', '.*line buffering \\(buffering=1\\)')

@sjg20
Copy link

sjg20 commented Feb 18, 2023

/usr/lib/python3.10/os.py:1029: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
return io.open(fd, mode, buffering, encoding, *args, **kwargs)

Can we remove line buffering from the os.fdopen() call here ?

https://github.com/cgoldberg/concurrencytest/blob/master/concurrencytest.py#L72

@sjg20
Copy link

sjg20 commented Feb 18, 2023

#15

@alan23273850
Copy link

Let's wait and see!

@mjstahlberg
Copy link
Author

That PR is identical to my #14 from two years ago. 😉

@alan23273850
Copy link

But the authors seem to do nothing?

@mjstahlberg
Copy link
Author

The author has not done a public action on GitHub since 2020-05-28.

sjg20 added a commit to sjg20/u-boot that referenced this issue Feb 19, 2023
While our version is better, it is tricky to use it when we are trying
to package things with pip. Drop it.

Somewhat reduced functionality is provided by the upstream version[1],
along with a rather annoying message each time it is used[2] [3].

[1] pip install concurrencytest
[2] cgoldberg/concurrencytest#12
[3] cgoldberg/concurrencytest#14
trini pushed a commit to trini/u-boot that referenced this issue Mar 9, 2023
While our version is better, it is tricky to use it when we are trying
to package things with pip. Drop it.

Somewhat reduced functionality is provided by the upstream version[1],
along with a rather annoying message each time it is used[2] [3].

[1] pip install concurrencytest
[2] cgoldberg/concurrencytest#12
[3] cgoldberg/concurrencytest#14

Signed-off-by: Simon Glass <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants