Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #15684

Re: Py2.7/FreeBSD: maximum number of open files

From Christian Heimes <lists@cheimes.de>
Subject Re: Py2.7/FreeBSD: maximum number of open files
Date 2011-11-14 19:03 +0100
References (2 earlier) <634914A010D0B943A035D226786325D42D0C2647C8@EXVMBX020-12.exch020.serverdata.net> <4EC1470B.90403@cheimes.de> <mailman.2705.1321290230.27778.python-list@python.org> <e3901b26-33ab-41b4-a8b1-82d08f15c125@u6g2000vbg.googlegroups.com> <634914A010D0B943A035D226786325D42D0C26481A@EXVMBX020-12.exch020.serverdata.net>
Newsgroups comp.lang.python
Message-ID <mailman.2708.1321293831.27778.python-list@python.org> (permalink)

Show all headers | View raw


Am 14.11.2011 18:46, schrieb Tobias Oberstein:
> I just confirmed that the bug is even there for FreeBSD 9 RC1 !
> 
> This is most unfortunate. Seriously.

W00t, that sucks! You could migrate to another BSD (NetBSD) or Linux ... :)

> I am running out of options, since I am willing to make my stuff Python 3 compatible,
> but Twisted is not yet there.
> 
> Using the backported new IO on Python 2.7 will not make open() automatically use the new IO, will it?

No, the open() function of Python 2.7 will still use the file class
which in return uses fopen(). You could try to monkey patch the built-in
open() function. It's mostly API compatible with the current open()
function:

  >>> import io, __builtin__
  >>> __builtin__.open = io.open

It works as long as no codes checks for isinstance(obj, file). If your
app only has to worry about log files, you might want to overwrite the
_open() method of logging.FileHandler and its subclasses.

Christian

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

AW: Py2.7/FreeBSD: maximum number of open files Tobias Oberstein <tobias.oberstein@tavendo.de> - 2011-11-14 09:03 -0800
  Re: Py2.7/FreeBSD: maximum number of open files Jon Clements <joncle@googlemail.com> - 2011-11-14 09:33 -0800
    AW: Py2.7/FreeBSD: maximum number of open files Tobias Oberstein <tobias.oberstein@tavendo.de> - 2011-11-14 09:46 -0800
    Re: Py2.7/FreeBSD: maximum number of open files Christian Heimes <lists@cheimes.de> - 2011-11-14 19:03 +0100
    AW: Py2.7/FreeBSD: maximum number of open files Tobias Oberstein <tobias.oberstein@tavendo.de> - 2011-11-14 10:28 -0800
    Re: Py2.7/FreeBSD: maximum number of open files Christian Heimes <lists@cheimes.de> - 2011-11-14 20:34 +0100
      Re: Py2.7/FreeBSD: maximum number of open files Chris Torek <nospam@torek.net> - 2011-11-30 19:29 +0000

csiph-web