|
Hi @zooba, could you review this PR if you have time? This PR seems necessary to correct a mistake I made previously. |
There was a problem hiding this comment.
Dont we need any tests for this change?
|
If we had failure tests for all APIs with audit hooks, then I'd insist upon it. But we don't, and this only would've been caught by having broad testing (100+ new tests). It's worth creating an issue for adding that set of tests. They ought to be fairly quick as well (though some will require e.g. making a real network connection, and most will require starting a new Python process for each API), but I think we can take this fix without adding all that. |
|
The following commit authors need to sign the Contributor License Agreement: |
There was a problem hiding this comment.
The CLA needs to be signed.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
msvcrt_get_osfhandle_implmsvcrt_get_osfhandle_impl
| { | ||
| if (PySys_Audit("msvcrt.get_osfhandle", "(i)", fd) < 0) { | ||
| return NULL; | ||
| return -1; |
There was a problem hiding this comment.
| return -1; | |
| return (void*)-1; |
|
Nothing heard from the OP, but also it doesn't seem to be necessary. This function call checks for any error, without looking at the return value. |
As per #18580,
msvcrt_get_osfhandle_implshould also return -1 instead ofNULLwhenPySys_Auditfails.https://bugs.python.org/issue39184