Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue2801] Py30a5 float.is_integer() raises ValueError

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

May 9, 2008, 4:28 AM

Post #1 of 8 (447 views)
Permalink
[issue2801] Py30a5 float.is_integer() raises ValueError

New submission from Mark Summerfield <mark [at] qtrac>:

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.

----------
messages: 66465
nosy: mark
severity: normal
status: open
title: Py30a5 float.is_integer() raises ValueError
type: behavior
versions: Python 3.0

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue2801>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 9, 2008, 6:47 AM

Post #2 of 8 (436 views)
Permalink
[issue2801] Py30a5 float.is_integer() raises ValueError [In reply to]

Mark Dickinson <dickinsm [at] gmail> 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

----------
nosy: +marketdickinson

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue2801>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 9, 2008, 6:55 AM

Post #3 of 8 (434 views)
Permalink
[issue2801] Py30a5 float.is_integer() raises ValueError [In reply to]

Mark Dickinson <dickinsm [at] gmail> added the comment:

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

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue2801>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 9, 2008, 6:56 AM

Post #4 of 8 (439 views)
Permalink
[issue2801] Py30a5 float.is_integer() raises ValueError [In reply to]

Mark Dickinson <dickinsm [at] gmail> added the comment:

That should be r62939, not r62938. Sorry.

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue2801>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 9, 2008, 7:02 AM

Post #5 of 8 (436 views)
Permalink
[issue2801] Py30a5 float.is_integer() raises ValueError [In reply to]

Changes by Mark Dickinson <dickinsm [at] gmail>:


----------
assignee: -> marketdickinson
priority: -> normal

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue2801>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 9, 2008, 7:33 AM

Post #6 of 8 (431 views)
Permalink
[issue2801] Py30a5 float.is_integer() raises ValueError [In reply to]

Mark Summerfield <mark [at] qtrac> added the comment:

On 2008-05-09, Mark Dickinson wrote:
> Mark Dickinson <dickinsm [at] gmail> 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.)

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue2801>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 9, 2008, 7:53 AM

Post #7 of 8 (434 views)
Permalink
[issue2801] Py30a5 float.is_integer() raises ValueError [In reply to]

Mark Summerfield <mark [at] qtrac> added the comment:

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

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue2801>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 9, 2008, 9:19 AM

Post #8 of 8 (442 views)
Permalink
[issue2801] Py30a5 float.is_integer() raises ValueError [In reply to]

Mark Dickinson <dickinsm [at] gmail> added the comment:

Thanks, Mark.

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

----------
resolution: -> fixed
status: open -> closed

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue2801>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.