-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-30665: fcntl.ioctl() now accepts larger range of integers #2286
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
bpo-30665: fcntl.ioctl() now accepts larger range of integers #2286
Conversation
as the third argument. On Linux signed and unsigned integers that fit in the size of C pointer are accepted. On other platforms integers that are representable as C types "int" or "unsigned int" are accepted.
" an integer and optionally an integer or buffer argument", | ||
&arg)) { | ||
return NULL; | ||
if (PyLong_Check(ob_arg)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that the i
code allowed integer-compatible objects, while you are mandating an actual int here. This could be a regression. Perhaps use PyNumber_Index()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the i
code is even more permissive (for example it accepts Decimal
and Fraction
). I have restored its logic for compatibility, but later I'm going to restrict the argument to index-like types in master.
@serhiy-storchaka I blurbified the PR for you. Because it is so old, you probably should rebase it though. |
I removed the " needs backport to 3.6" label, the 3.6 branch no longer accept bugfixes (only security fixes are accepted): https://devguide.python.org/#status-of-python-branches |
@serhiy-storchaka, this is marked as a bug fix and the window for bug fixes for 3.7 closes in a few weeks. I didn't know if you wanted to try to get it in before then. Thanks! |
I don't think we should put a change of behavior like this into the last bugfix release of 3.7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to have a test that passes a big int?
This PR is stale because it has been open for 30 days with no activity. |
This missed the boat for inclusion in Python 3.9 which accepts security fixes only as of today. |
This PR is stale because it has been open for 30 days with no activity. |
This PR is stale because it has been open for 30 days with no activity. |
It is not correct, because even on Linux some calls require an argument of type |
as the third argument.
On Linux signed and unsigned integers that fit in the size of
C pointer are accepted. On other platforms integers that are
representable as C types "int" or "unsigned int" are accepted.
https://bugs.python.org/issue30665