This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2008年07月08日 08:44 by mokeefe, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| pystone_1_py3k.diff | mokeefe, 2008年07月09日 04:11 | patch for python 3.0 on Lib/test/pystone.py | ||
| pystone_1_trunk.diff | mokeefe, 2008年07月09日 04:11 | patch for python 2.6 trunk to Lib/test/pystone.py | ||
| pystone_err.py | mokeefe, 2008年07月09日 04:12 | file to demonstrate the ZeroDivisionError | ||
| Messages (4) | |||
|---|---|---|---|
| msg69418 - (view) | Author: Michael Patrick O'Keefe (mokeefe) | Date: 2008年07月08日 08:44 | |
The following call results in a ZeroDivisionError in python 2.5.2 and python 3.0 alpha 3 (I presume this is also an issue for Python 2.6 but I can't explicitly confirm): >>> from test import pystone >>> pystone.main(10) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.0/lib/python3.0/test/pystone.py", line 61, in main benchtime, stones = pystones(loops) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.0/lib/python3.0/test/pystone.py", line 68, in pystones return Proc0(loops) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.0/lib/python3.0/test/pystone.py", line 131, in Proc0 return benchtime, (loops / benchtime) ZeroDivisionError: float division Note the patch I submitted checks if the benchtime is equal to 0.0 (which apparently happens on my Mac OS 10.5 PPC). If this is the case I arbitrarily set the benchtime to 1e-6. I'm not sure what the units of the benchtime variable is (seconds?). Anyhow, this fixes the issue but can someone review to confirm this is the correct behavior? Thanks! -Michael |
|||
| msg69420 - (view) | Author: Michael Patrick O'Keefe (mokeefe) | Date: 2008年07月08日 09:02 | |
I'm resubmitting the patch -- I think this one's a little bit better than my first attempt. I only change the value of loops / benchtime |
|||
| msg69456 - (view) | Author: Michael Patrick O'Keefe (mokeefe) | Date: 2008年07月09日 04:11 | |
After a more careful study of the documentation on how to make (proper) patches, I'm submitting the patches again. This patches against the 2.6 trunk and py3k branch (R64812). I compiled both 2.6 and py3k and confirmed that the ZeroDivisionError does not appear for both sets of code. |
|||
| msg70017 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2008年07月19日 13:00 | |
Thanks, fixed in trunk in r65135, will be merged to Py3k automatically. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:36 | admin | set | github: 47569 |
| 2008年07月19日 13:00:42 | georg.brandl | set | status: open -> closed nosy: + georg.brandl messages: + msg70017 resolution: fixed |
| 2008年07月09日 04:12:47 | mokeefe | set | files: + pystone_err.py |
| 2008年07月09日 04:11:57 | mokeefe | set | files: + pystone_1_trunk.diff |
| 2008年07月09日 04:11:16 | mokeefe | set | files:
+ pystone_1_py3k.diff messages: + msg69456 versions: + Python 2.6 |
| 2008年07月09日 04:02:31 | mokeefe | set | files: - pystone.py.patch |
| 2008年07月08日 09:02:32 | mokeefe | set | files:
+ pystone.py.patch keywords: + patch messages: + msg69420 |
| 2008年07月08日 08:56:11 | mokeefe | set | files: - pystone_patch.txt |
| 2008年07月08日 08:44:05 | mokeefe | create | |