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 n8henrie
Recipients n8henrie, ned.deily
Date 2018-03-16.15:08:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1521212897.06.0.467229070634.issue33036@psf.upfronthosting.co.za>
In-reply-to
Content
Update -- I found the following plist at `/Library/LaunchDaemons/limit.maxfiles.plist`:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>limit.maxfiles</string>
    <key>ProgramArguments</key>
    <array>
      <string>launchctl</string>
      <string>limit</string>
      <string>maxfiles</string>
      <string>64000</string>
      <string>524288</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>ServiceIPC</key>
    <false/>
  </dict>
</plist>
```

I think I made this file at some point to deal with an error about insufficient file descriptors while playing with asyncio / sockets. After `launchctl unload`ing it and rebooting **the test now passes**, and I now see a *much* higher hard limit (similar to that posted by Ned) with the `getrlimit()` command, and `unlimited` as the hard limit with `launchtl limit`.

I can reproduce the failure by restoring my prior settings:

```bash
$ sudo launchctl limit maxfiles 64000 524288
$ ulimit -n 64000
$ 
$ ./python.exe -m unittest -v test.test_selectors.PollSelectorTestCase.test_above_fd_setsize
test_above_fd_setsize (test.test_selectors.PollSelectorTestCase) ... ERROR

======================================================================
ERROR: test_above_fd_setsize (test.test_selectors.PollSelectorTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/n8henrie/git/cpython/Lib/test/support/__init__.py", line 600, in wrapper
    return func(*args, **kw)
  File "/Users/n8henrie/git/cpython/Lib/test/test_selectors.py", line 453, in test_above_fd_setsize
    self.assertEqual(NUM_FDS // 2, len(s.select()))
  File "/Users/n8henrie/git/cpython/Lib/selectors.py", line 376, in select
    fd_event_list = self._poll.poll(timeout)
OSError: [Errno 22] Invalid argument

----------------------------------------------------------------------
Ran 1 test in 9.771s

FAILED (errors=1)

```
History
Date User Action Args
2018-03-16 15:08:17n8henriesetrecipients: + n8henrie, ned.deily
2018-03-16 15:08:17n8henriesetmessageid: <1521212897.06.0.467229070634.issue33036@psf.upfronthosting.co.za>
2018-03-16 15:08:17n8henrielinkissue33036 messages
2018-03-16 15:08:16n8henriecreate