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.

Author maltehelmert
Recipients belopolsky, christian.heimes, gvanrossum, maltehelmert, pitrou, rbp
Date 2008-02-24.17:03:08
SpamBayes Score 0.0033077146
Marked as misclassified No
Message-id <1203872590.24.0.931154805151.issue1040026@psf.upfronthosting.co.za>
In-reply-to
Content
Here is an updated patch (os_times4.PATCH) that incorporates Christian's
suggestions. The patch includes the new unit test, so test_posix?.PATCH
need not be applied separately.

I again made the unit test a bit more lenient to allow an absolute error
of 0.02 seconds, as there may be systems where the clock tick
granularity is only 1/60 seconds, and then the old tolerance of 0.015
seconds would be too low.

This patch prefers sysconf where it is available; this is what "man 2
times" asks to do. If sysconf is available but produces an error, that
error is raised. (Errors should never pass silently.) HZ is only used if
sysconf is not available. If neither sysconf nor HZ is available, a
compile-time error is raised -- in that case, HAVE_TIMES shouldn't have
been defined in the first place.

I also timed this; there is no discernible change compared to the old
behaviour.

The patch fixes the buggy behaviour on my 64-bit Linux box and makes no
difference on my 32-bit Linux box. The new unit test passes on both
machines.
History
Date User Action Args
2008-02-24 17:03:10maltehelmertsetspambayes_score: 0.00330771 -> 0.0033077146
recipients: + maltehelmert, gvanrossum, belopolsky, pitrou, christian.heimes, rbp
2008-02-24 17:03:10maltehelmertsetspambayes_score: 0.00330771 -> 0.00330771
messageid: <1203872590.24.0.931154805151.issue1040026@psf.upfronthosting.co.za>
2008-02-24 17:03:09maltehelmertlinkissue1040026 messages
2008-02-24 17:03:08maltehelmertcreate