`os.EX_NOTFOUND` was... not found
In the module os, EX_NOTFOUND is exposed on platforms that are neither win32 nor darwin. (source)
Using Python 3.11.6 on EndeavourOS 64-bit (Linux 6.6.10-arch1-1), raises at runtime:
AttributeError: module 'os' has no attribute 'EX_NOTFOUND'
I can also reproduce it with:
- Python 3.9.18
- Python 3.8.18
- Python 3.13.0 (built from source from the
mainbranch)
According to https://stackoverflow.com/questions/51322536/python-on-unix-value-of-os-ex-notfound it exists on e.g. Solaris. We should add an and sys.platform != "linux" to the condition. PR welcome!
@qexat Thanks for the issue! :-) I am kind of curious — what were you doing that led you to noticing this?
(In general, determining platform availability of constants has been a little tricky for Linux, since Linux / Python builds on Linux is not a monolith. So I'm quite curious about use cases that depend on this. As per usual, typeshed prefers false negatives over false positives, so we likely overstate constant availability on Linux anywhere we have a regex in stubtest allowlists)
@qexat Thanks for the issue! :-) I am kind of curious — what were you doing that led you to noticing this?
For my snippets repository, I was writing a little dependency checker (very basic and in a few lines, really) that exits early with a code and I wanted to try using os constants — the module supposedly makes programs more portable :)