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
[BUG] cython
command prints stdout-type information to stderr
#5504
Comments
ISTM that 3.0 would be the right time to fix this. Not sure if it's a) important enough to b) still change it at this point. |
It turns out fixing this broke meson, see scipy/scipy#18865. Two thoughts
|
I could live with the ugliness of writing the version to both stdout and stderr in 3.0 and then removing the stderr print after changing the master branch to 3.1-pre. That way, things would keep working for another while and tools would get time to adapt. (Although they probably wouldn't until things start failing again…) Or, we revert the whole thing. We've been living with the stderr version output for 20 years. It's unexpected, and wouldn't be done like this if it wasn't there already, but it's not at all harmful. |
cc @eli-schwartz, I think meson is going to make a quick-fix release to deal with this. |
That would be great. But as you also noted in the scipy ticket, it's probably not the only tool that wants to read the version. |
… captured and not just printed alongside with stdout. See #5504
I pushed a change that writes the version to stderr as well, unless that's a TTY. That way, we won't print it twice, at least, but would still make it available to tools that read from Cython's stderr. |
Are we worried that this blocks too many people from testing the release candidate? (i.e. does this justify needing a second release candidate?) Or has Meson successfully worked round it too? |
Cython historically, when asked to print the version and exit successfully, would do so on stderr, which is weird and inconsistent. Recently, it fixed this UX bug by printing on stdout instead: cython/cython#5504 This then broke meson detection because we assumed it was on stderr due to historically being there: scipy/scipy#18865 Cython is right, and shouldn't have to revert this reasonable change for backwards compatibility. Instead, check both.
To clarify, meson is currently running its own release candidate 3 and the final release is expected on Sunday if all goes well. The fix is merged to meson git master, and will be part of that feature release.
When is cython hoping to release the final release? |
…from stdout At least one project tries to detect the Cython version by redirecting stderr to stdout and capturing it. This is done in pure POSIX shell, so it probably seemed like the simple and obvious solution for a less capable programming language given that no output at all was expected on stdout. But the result is that the version number appears twice, and then gets misparsed and ends up triggering bad assumptions in the code running cython. It turns out that it's pretty easy to just print once, though. Detect when stdout and stderr are redirected to the same location, and only print once. See cython#5504 Fixes https://bugs.gentoo.org/911333
…from stdout (GH-5572) At least one project tries to detect the Cython version by redirecting stderr to stdout and capturing it. This is done in pure POSIX shell, so it probably seemed like the simple and obvious solution for a less capable programming language given that no output at all was expected on stdout. But the result is that the version number appears twice, and then gets misparsed and ends up triggering bad assumptions in the code running cython. It turns out that it's pretty easy to just print once, though. Detect when stdout and stderr are redirected to the same location, and only print once. See #5504 Fixes https://bugs.gentoo.org/911333
Cython historically, when asked to print the version and exit successfully, would do so on stderr, which is weird and inconsistent. Recently, it fixed this UX bug by printing on stdout instead: cython/cython#5504 This then broke meson detection because we assumed it was on stderr due to historically being there: scipy/scipy#18865 Cython is right, and shouldn't have to revert this reasonable change for backwards compatibility. Instead, check both.
Describe the bug
As reported on the mailing list, the
cython
command prints things to stderr that should go to stdout.Code to reproduce the behaviour:
Expected behaviour
No response
OS
No response
Python version
No response
Cython version
0.29.35, probably also master
Additional context
No response
The text was updated successfully, but these errors were encountered: