-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
PyArg_Parse* should raise TypeError for float parsed with integer format #49330
Comments
Since Python 2.3, PyArg_ParseTuple and friends give a DeprecationWarning
Can we turn that DeprecationWarning into a TypeError for 2.7? (It's N.B. The relevant format codes in 2.7 include 'I' and 'n' in addition to |
+1. |
+10. It would fix the os.urandom(1.2) bug. On Linux, os.urandom() displays /usr/lib/python2.5/os.py:734: DeprecationWarning: integer argument expected, read(1.2 - 1) ~> read(0.2) ~> read(0)... Tolerate float as integers introduces "subtle" bugs like byte/unicode bugs... |
+1 for a TypeError too. |
I think this should be signalled on the mailing-list, by the way. I |
Yes, checking with python-dev sounds sensible. I'll wait until there's |
Hmm. That's unfortunate: for argument type in 'bBHiIlkKn', an attempt to I'm not sure what 'h' does; there don't appear to be any tests for it, |
'h' also produces a DeprecationWarning; I just added the missing tests |
Here's a patch that makes the DeprecationWarning a TypeError, and adds a |
Applied to trunk in r77218. The DeprecationWarning for the 'L' format |
Merged relevant bits to py3k in r77220. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: