-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
bpo-41056: Use the fildes converter for fd to please Coverity. #21011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
there are a bunch of other fd: int uses in this file, I expect many if not all of them would be better off using the fildes converter. This particular one was flagged by Coverity as it presumably flags fpathconf as not accepting negative fds. I'd expect the other fd's to have been flagged as well otherwise.
|
Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
|
Sorry, @gpshead, I could not cleanly backport this to |
|
Sorry @gpshead, I had trouble checking out the |
|
@gpshead Coverity is generally very picky when it comes to negative ints in file functions. I tend to flag them as invalid because they are harmless and Coverity does not understand our safe guards. |
|
Using the
I think it is a new feature, and therefore it should not be backported. Before merging it we perhaps need to add support of objects with the You can just add an explicit check for negative |
|
I'm wondering why anyone would ever pass an object with an anyways agreed about not backporting; this wasn't a major bug given it is the os module. |
|
Would you mind to add to the NEWS entry that |
…nGH-21011) There are a bunch of other fd: int uses in this file, I expect many if not all of them would be better off using the fildes converter. This particular one was flagged by Coverity as it presumably flags fpathconf as not accepting negative fds. I'd expect the other fd's to have been flagged as well otherwise. I'm marking this one as skip news as it really is a no-op.
There are a bunch of other fd: int uses in this file, I expect many if not
all of them would be better off using the fildes converter. This particular
one was flagged by Coverity as it presumably flags fpathconf as not accepting
negative fds. I'd expect the other fd's to have been flagged as well
otherwise.
I'm marking this one as skip news as it really is a no-op.
https://bugs.python.org/issue41056
Automerge-Triggered-By: @tiran