well, I found out it must be some problem with gtk module. When I leave
it this order it appears again.
2012/1/17 Peter Irbizon <peterirbizon(at)gmail(dot)com>
> Hello Jason, thanks for your effort again and sorry for my late answer.
> To remove all "uniquenesses" of my program I removed all unnecessary
> pieces of code and left only this:
> # -*- coding: utf-8 -*-
> import pygtk
> import gtk
> import psycopg2
> import psycopg2.extras
> conn = psycopg2.connect("dbname='' host='' user='' password='' port=''");
> cur = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
> cur.execute("select * from table")
> print "\nShow me the databases:\n"
> for row in cur:
> aa = '%(bb)s' % row
> bb = '%(aa)s' % row
> print aa + ' '+ bb
> but in my case it appears again. As I mentiones when I reorder importing -
> for example import psycopg2 goes to second line it works ok. I am not so
> experienced user of python to be able to say what causes this behaviour.
> sorry. maybe it can be really "networking" in pygtk library and maybe not.
> But it is quite interesting that in your case you can reproduce this
> behaviour. thanks again for your help .
> 2012/1/12 Jason Erickson <jason(dot)erickson(at)stickpeople(dot)com>
>> Thanks for the info and update, Peter. Interesting that it ran alright
>> after rearranging the the import order.
>> Initially I was thinking some common library that both modules use was
>> not being cleaned up correctly on exit/tear down. Could still be the case,
>> but not seeing the commonality between the two. Correct me if I'm wrong,
>> as I'm not familiar with pygtk, but I did not see a 'networking' library in
>> pygtk (for example, pyqt has the qtnetwork module).
>> I did try a simple pygtk script (the hello world example from pygtk) and
>> added psycopg code to it, but unfortunatley was not able to duplicate the
>> problem. Can you think of any uniqueness to your program? You mentioned a
>> timer, are you spawning off a thread yourself, using the gtk timer, or
>> something else?
In response to
psycopg by date
|Next:||From: Vojtěch Rylko||Date: 2012-01-30 16:09:15|
|Subject: Named cursor problem|
|Previous:||From: Peter Irbizon||Date: 2012-01-17 14:53:51|
|Subject: Re: after application close MS Visual C++ runtime library