On Tue, Sep 06, 2016 at 08:41:48AM -0400, D'Arcy J.M. Cain wrote:
> On Tue, 30 Aug 2016 12:22:10 -0500
> Justin Pryzby <[email protected]> wrote:
> > I believe this is triggering infinite recursion:
> >
> > pg.py class DB:
> >
> > def __getattr__(self, name):
> > # All undefined members are same as in underlying connection:
> > if self.db:
> > return getattr(self.db, name)
> >
> > "if self.db" seems to be itself calling getattr (?)
>
>
> Do you have a code snippet that you think is triggering an infinite
> recursion here?
Here's a minimal test:
$ for a in `seq 99`; do psql & done # suck up all available connections
$ python
[...]
>>> import pg,sys
>>> d=pg.DB()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.6/site-packages/pg.py", line 1383, in __init__
db = connect(*args, **kw)
pg.InternalError: FATAL: sorry, too many clients already
>>> sys.exit()
Exception RuntimeError: 'maximum recursion depth exceeded while calling a
Python object' in <type 'exceptions.AttributeError'> ignored
Exception RuntimeError: 'maximum recursion depth exceeded while calling a
Python object' in <type 'exceptions.AttributeError'> ignored
Exception RuntimeError: 'maximum recursion depth exceeded while calling a
Python object' in <type 'exceptions.AttributeError'> ignored
[...]
Justin
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql