Pathconf names by marvinmednick · Pull Request #4508 · RustPython/RustPython
I'm looking at the error -- I found an online free online macos simlulator and was able to get the error 22 manually trying the command os.pathconf('/',21) but that isn't conclusive. (pathconf worked for indexes 0-20).
I'd like to check the the PathconfVar entries for darwin... but darwin doesn't seem to be a confguration check within PathconfVar
It looks like there are some platforms which may have pathconf indexes that are greater then 20 (e.g. in libc
libc: src/unix/haiku/mod.rs:pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 32;
though on linux the same parameter is index 15.
libc src/unix/linux_like/linux/mod.rs:pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
I suppose this is more a of libc specfic question does anyone know how can I tell which of the libc flavor will be used on macos/darwin? (and therefore which pathconf indexes value will show up in PathconfVar)
Clarifying -
Change is now failing due to test running on darwin (which started running when making the change to the conditional to allow it to run on darwin. It suspect that one of the entries in PathconfVar isn't valid on that platform - the code takes all the variants in enums and converts them to the dict form. The test verifies the the value that one gets when using the name is the same as the value when using the index which should always be true, However the test is failing when it gets an error value as the parameter -- which I belive is coming from the enum.
As a result I suspect there may be a value in PathconVar which isn't valid for pathconf on that platform.... (and causing the error)
The test could be simplified to only check a few manually selected values rather , but if this is actually I think it would be better to fix PathconfVar to have the correct values for the platform.