Re: [sqlalchemy] [psql] string escaping quirk in like clauses

2013-07-04 Thread Burak Arslan
On 06/27/13 13:41, Simon King wrote: Remember that Python also has its own string escaping. When you write a literal '\\' in Python, you are creating a string containing a single backslash. Hi Simon, I'm aware of that. My issue is that SQLAlchemy produces an invalid query for .like('\\') in

[sqlalchemy] QueuePool connections counter leak

2013-07-04 Thread Navid Sheikhol Eslami
I believe I have found a bug in QueuePool causing it to leak connections during instantiation of _ConnectionFairy objects, when get_connection() raises an exception. A simple way to reproduce this is to have a connection expire and simulate a network issue to have get_connection() raise an

Re: [sqlalchemy] [psql] string escaping quirk in like clauses

2013-07-04 Thread Michael Bayer
do you mean to say r'\\' there ? On Jun 27, 2013, at 9:11 PM, Burak Arslan burak.ars...@arskom.com.tr wrote: On 06/27/13 13:41, Simon King wrote: Remember that Python also has its own string escaping. When you write a literal '\\' in Python, you are creating a string containing a single

Re: [sqlalchemy] QueuePool connections counter leak

2013-07-04 Thread Michael Bayer
I'll have to work up a more self contained test using mocks (the approach can be seen here: https://github.com/zzzeek/sqlalchemy/blob/master/test/engine/test_reconnect.py#L21) so that this can be tested completely - if overflow is counting incorrectly, the implication is that the pool will

Re: [sqlalchemy] [psql] string escaping quirk in like clauses

2013-07-04 Thread Michael Bayer
here's a test, passes for me (even that it uses terrible names for the bound parameters in this case): from sqlalchemy import create_engine from sqlalchemy.sql import literal_column, select e = create_engine(postgresql://scott:tiger@localhost/test, echo=True) assert

Re: [sqlalchemy] QueuePool connections counter leak

2013-07-04 Thread Navid Sheikhol Eslami
On Thursday, July 4, 2013 7:00:18 AM UTC-7, Michael Bayer wrote: I'll have to work up a more self contained test using mocks (the approach can be seen here: https://github.com/zzzeek/sqlalchemy/blob/master/test/engine/test_reconnect.py#L21) so that this can be tested completely - if

Re: [sqlalchemy] QueuePool connections counter leak

2013-07-04 Thread Michael Bayer
OK that issue is fixed in master and 0.8. thanks for the report! On Jul 4, 2013, at 12:44 PM, Navid Sheikhol Eslami na...@navid.it wrote: On Thursday, July 4, 2013 7:00:18 AM UTC-7, Michael Bayer wrote: I'll have to work up a more self contained test using mocks (the approach can be seen