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
Py30a5 float.is_integer() raises ValueError #47050
Comments
The new method float.is_integer() introduced in Py30a5 behaves unexpectedly: >>> x = 5.0
>>> x.as_integer_ratio()
(5, 1)
>>> x.is_integer()
Traceback (most recent call last):
File "<pyshell#20>", line 1, in <module>
x.is_integer()
ValueError: (11, 'Resource temporarily unavailable') I was expecting True. |
Is this on Windows? I can't reproduce it on OS X 10.5.2: Python 3.0a5+ (py3k:62937M, May 9 2008, 09:32:27)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 5.0
>>> x.is_integer()
True |
This should be fixed in r62938. Mark, can you confirm? |
That should be r62939, not r62938. Sorry. |
On 2008-05-09, Mark Dickinson wrote:
> Mark Dickinson <dickinsm@gmail.com> added the comment:
>
> Is this on Windows? I can't reproduce it on OS X 10.5.2:
>
> Python 3.0a5+ (py3k:62937M, May 9 2008, 09:32:27)
> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> x = 5.0
> >>> x.is_integer()
>
> True I'm on Linux: '3.0a5 (r30a5:62856, May 9 2008, 11:23:06) \n[GCC 4.1.2 20070925 (Red Hat
4.1.2-33)]'
>>> (5.).as_integer_ratio()
(5, 1)
>>> (5.).is_integer()
Traceback (most recent call last):
File "<pyshell#99>", line 1, in <module>
(5.).is_integer()
ValueError: (11, 'Resource temporarily unavailable') (I can't test on Windows because Py30a5 isn't available for it yet.) |
OK, I've just built against your fix and it works fine now! Python 3.0a5+ (py3k:60668:62940, May 9 2008, 15:48:15)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> (5.).as_integer_ratio()
(5, 1)
>>> (5.).is_integer()
True |
Thanks, Mark. I've also backported the fix to the trunk in r62943. |
ValueError: (11, 'Resource temporarily unavailable') looks to me like a Cygwin error relating to Windows' DLLs and the difficulty of mapping them to unique memory locations. I very much doubt it's a real issue with Python, so closing the issue appears to be the correct decision in the absence of further contradictory information from the OP. |
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: