Skip to content
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

Closed
mark-summerfield mannequin opened this issue May 9, 2008 · 8 comments
Closed

Py30a5 float.is_integer() raises ValueError #47050

mark-summerfield mannequin opened this issue May 9, 2008 · 8 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@mark-summerfield
Copy link
Mannequin

mark-summerfield mannequin commented May 9, 2008

BPO 2801
Nosy @mdickinson, @mark-summerfield

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:

assignee = 'https://github.com/mdickinson'
closed_at = <Date 2008-05-09.16:19:20.625>
created_at = <Date 2008-05-09.11:28:49.866>
labels = ['type-bug']
title = 'Py30a5 float.is_integer() raises ValueError'
updated_at = <Date 2011-11-05.04:40:45.483>
user = 'https://github.com/mark-summerfield'

bugs.python.org fields:

activity = <Date 2011-11-05.04:40:45.483>
actor = 'holdenweb'
assignee = 'mark.dickinson'
closed = True
closed_date = <Date 2008-05-09.16:19:20.625>
closer = 'mark.dickinson'
components = []
creation = <Date 2008-05-09.11:28:49.866>
creator = 'mark'
dependencies = []
files = []
hgrepos = []
issue_num = 2801
keywords = []
message_count = 8.0
messages = ['66465', '66468', '66469', '66470', '66473', '66476', '66481', '147068']
nosy_count = 3.0
nosy_names = ['holdenweb', 'mark.dickinson', 'mark']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue2801'
versions = ['Python 3.0']

@mark-summerfield
Copy link
Mannequin Author

mark-summerfield mannequin commented May 9, 2008

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.

@mark-summerfield mark-summerfield mannequin added the type-bug An unexpected behavior, bug, or error label May 9, 2008
@mdickinson
Copy link
Member

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

@mdickinson
Copy link
Member

This should be fixed in r62938. Mark, can you confirm?

@mdickinson
Copy link
Member

That should be r62939, not r62938. Sorry.

@mdickinson mdickinson self-assigned this May 9, 2008
@mark-summerfield
Copy link
Mannequin Author

mark-summerfield mannequin commented May 9, 2008

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.)

@mark-summerfield
Copy link
Mannequin Author

mark-summerfield mannequin commented May 9, 2008

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

@mdickinson
Copy link
Member

Thanks, Mark.

I've also backported the fix to the trunk in r62943.

@holdenweb
Copy link
Member

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants