Charles-François Natali added the comment:

> R. David Murray added the comment:
>
> See also issue issue 17409.
>
> The code isn't setting it to RLIM_INFINITY explicitly, though, so this must 
> mean that OSX is reporting an infinite hard limit when the hard limit is not 
> in fact infinite.  Seems like this is an OSX bug that we will have to work 
> around somehow.

Indeed.
I saw this while testing on "custom" buildbots, and opted for the
simplest solution: I added a @require_mac_version decorator, hoping
this would be solved in recent OSX versions. Apparently not :)

As a simple check, does the following work on OSX ?
>>> limit = resource.getrlimit(resource.RLIMIT_NOFILE)
>>> resource.setrlimit(resource.RLIMIT_NOFILE, limit)

Does the attached patch solve this?

----------
keywords: +patch
Added file: http://bugs.python.org/file31660/selectors_osx.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18963>
_______________________________________
diff -r 14972c999e80 Lib/test/test_selectors.py
--- a/Lib/test/test_selectors.py        Fri Sep 06 21:12:22 2013 +0200
+++ b/Lib/test/test_selectors.py        Sun Sep 08 10:28:48 2013 +0200
@@ -301,7 +301,6 @@
 
 class ScalableSelectorMixIn:
 
-    @support.requires_mac_ver(10, 5)
     @unittest.skipUnless(resource, "Test needs resource module")
     def test_above_fd_setsize(self):
         # A scalable implementation should have no problem with more than
@@ -313,7 +312,7 @@
             self.addCleanup(resource.setrlimit, resource.RLIMIT_NOFILE,
                             (soft, hard))
             NUM_FDS = hard
-        except OSError:
+        except (OSError, ValueError):
             NUM_FDS = soft
 
         # guard for already allocated FDs (stdin, stdout...)
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to