Skip to content

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

Closed

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jun 20, 2017

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

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)) {
Copy link
Member

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()?

Copy link
Member Author

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.

@ned-deily
Copy link
Member

@serhiy-storchaka I blurbified the PR for you. Because it is so old, you probably should rebase it though.

@vstinner
Copy link
Member

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

@csabella
Copy link
Contributor

@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!

@ned-deily
Copy link
Member

I don't think we should put a change of behavior like this into the last bugfix release of 3.7.

Copy link
Contributor

@MaxwellDupre MaxwellDupre left a 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?

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Mar 21, 2022
@ambv ambv removed the needs backport to 3.9 only security fixes label May 17, 2022
@ambv
Copy link
Contributor

ambv commented May 17, 2022

This missed the boat for inclusion in Python 3.9 which accepts security fixes only as of today.

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label May 18, 2022
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jun 18, 2022
@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Jul 28, 2022
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Aug 28, 2022
@ukl ukl mannequin mentioned this pull request Nov 28, 2023
@serhiy-storchaka
Copy link
Member Author

It is not correct, because even on Linux some calls require an argument of type int (e.g. file descriptor).

@serhiy-storchaka serhiy-storchaka deleted the ioctl-third-argument branch December 24, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review stale Stale PR or inactive for long period of time. type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.