-
Notifications
You must be signed in to change notification settings - Fork 1.3k
print throws error with "flush" argument #4888
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
Comments
hmmm -- may just be on the nRF52840
|
Nope....
also failed on an STM32F405 and an ESP32S2
|
Lines 494 to 496 in 84e1d77
ioctl support for stdout on those ports. It may just be a typo somewhere. |
This works on Metro M0 and fails on Metro M4. I believe the difference is whether |
It looks like MICROPY_PY_IO gets enabled if JSON is enabled. Is this likely an upstream issue? |
Yes, it is all a micropythonism. It provides the io module, whose code also seems to provide extra functionality for stdin/stdout (maybe...), and is also needed by |
Why does PY_IO disable |
FWIW this is also affecting the FeatherS2 — and it's a regression from CircuitPython 6.2.
|
There is a regression in CiruitPython 7 alpha that throws an OSError when using `flush=True`: adafruit/circuitpython#4888 This makes sure the code works both for CircuitPython 6 and 7.
This is actually more correct. The change comes from the 1.13 merge where I removed the "pretend to flush" https://github.com/adafruit/circuitpython/pull/1555/files#diff-d10683776c4bfa5c707b7af8a20a136c9d59131e9803ba1bc547020e43fe0704R92. Basically, the old version was lying to you that it actually flushed. So I propose we leave it as-is. We're on a major version boundary so breaking something "that used to work" is ok. |
I don't think it's worth worrying about this. Very little code uses flush. If you have a reason you'd like to to work, then please file a new issue. If needed, we can make it work without IO instead of faking the flush. |
Just ran across this on CLUE (nrf52840)
using the "flush" argument for print throws an error
The text was updated successfully, but these errors were encountered: