
"Alexandre Vassalotti" <alexandre@peadrop.com> writes:
So now I am not sure what OP is proposing. Do you want to replace 21 with EISDIR in the above?
Yes, that's what I had in mind.
Then, check out EnvironmentError_str in Objects/exceptions.c. You should be able import the errno module and fetch its errorcode dictionary.
It wasn't as hard as I expected. It's the first time that I play with the Python C API; I didn't expect the API to be that high level. I attached a patch to convert errno to its symbolic value when an EnvironmentError is printed. Should attach it to a ticket on bugs.python.org? I'm sure there is a style guide like PEP-8 for C code, feel free to point me to it because my patch is probably not fully style compliant. With Emacs, doing M-x c-set-style python doesn't seems to do the right thing. Are you all using a bunch of shared settings in you .emacs files? -- Yannick Gingras