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 neologix
Recipients alex, christian.heimes, dstufft, hynek, jcea, neologix, pitrou, python-dev, tarek, vstinner
Date 2013-08-24.17:49:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
> New changeset fe949918616c by Antoine Pitrou in branch 'default':
> Issue #18756: Improve error reporting in os.urandom() when the failure is due to something else than /dev/urandom not existing.

Antoine, this changeset broke Tiger buildbots badly:
ERROR: test_urandom_failure (test.test_os.URandomTests)
Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/",
line 1033, in test_urandom_failure
ValueError: not allowed to raise maximum limit

1030 # We restore the old limit as soon as possible. If doing it
1031 # using addCleanup(), code running in between would fail
1032 # creating any file descriptor.
1033 resource.setrlimit(resource.RLIMIT_NOFILE, (soft_limit, hard_limit))

The code trying to reset RLIMIT_NOFILE to its previous value fails,
and as a consequence, all subsequent FDs creation fail (since the soft
limit it 1)...

It looks like Tiger getrlimit() return a nonsensical value (maybe -1),
which means that you can't do setrlimit(getrlimit()), or yet another
OS X bug (TM).
See e.g.

I'd suggest two things:
- skip it on Tiger (using support.requires_mac_vers() decorator)
- run the test in a subprocess (using the test in your latest patch
would be fine), to be more robust against this
Date User Action Args
2013-08-24 17:49:35neologixsetrecipients: + neologix, jcea, pitrou, vstinner, christian.heimes, tarek, alex, python-dev, hynek, dstufft
2013-08-24 17:49:35neologixlinkissue18756 messages
2013-08-24 17:49:35neologixcreate