You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It writes to stderr and exits with non-zero error code, so that CI systems can know it doesn't work.
I've also tested it using sh on both mac and windows. Essentially it just gives a nicer error, which signposts the user to maybe use Docker (if they insist on using non linux or darwin systems).
All I'm shooting for here is a better error message, than an import error, for something folks have come to expect as part of the standard library (probably their fault, but I came across this with a user of mastodon complaining about Python, not sh and not fcntl)
I have asked PyPi to release the fcntl name to me, so that folks can pip install fcntl which I tested using a virtual environment using poetry, within the sh project itself to check it works.
But a nicer error for others without the shenanigans I went through might be better for all.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
The text was updated successfully, but these errors were encountered:
Unfortunately, I don't think this is a minor feature--please discuss it on Discourse first. A fair warning: you'll certainly get pushback there. In which case, that doesn't mean the idea is bad! In my experience, people very rarely shift opinions on discourse, I wouldn't bother with trying to get in arguments with them :)
A few notes about your polyfill implementation:
Printing to stderr and then calling exit is a bad idea for the standard library. Users don't really have a good way of preventing that message from coming up, other than disabling stderr entirely. Instead of printing, just raise an error.
I do like the idea of nicer import errors for OS-dependent libraries, but this should apply to all of those modules, not just fcntl--for example, curses and msvcrt have this problem as well. I would focus your proposal on discourse around that.
I'm going to close this for the time being. Let me know if you have any other questions, thanks!
Thank you. I knew this would be the long and slow fix route internally. I'll now begin trying to search for similar issues on Discourse... If nobody hears from me again, I gave up 😆
Feature or enhancement
Proposal:
The following line errors on Windows
It's error is not helpful at all, but powers library code sysadmins use, such as
sh
:To provide the minimum amount of confusion, I've written a polyfill:
https://github.com/Lewiscowles1986/python-fcntl
It writes to stderr and exits with non-zero error code, so that CI systems can know it doesn't work.
I've also tested it using
sh
on both mac and windows. Essentially it just gives a nicer error, which signposts the user to maybe use Docker (if they insist on using non linux or darwin systems).All I'm shooting for here is a better error message, than an import error, for something folks have come to expect as part of the standard library (probably their fault, but I came across this with a user of mastodon complaining about Python, not sh and not fcntl)
https://mastodon.social/@mistersql/113314636889503344
I have asked PyPi to release the fcntl name to me, so that folks can
pip install fcntl
which I tested using a virtual environment using poetry, within thesh
project itself to check it works.But a nicer error for others without the shenanigans I went through might be better for all.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
The text was updated successfully, but these errors were encountered: