Re: after application close MS Visual C++ runtime library error occurs - Mailing list psycopg

From Peter Irbizon
Subject Re: after application close MS Visual C++ runtime library error occurs
Date
Msg-id CABFuWSz7Yq7sAyM0+RwdPdhAwRJcBo5dfUtEkkAgBfO+wr6VrQ@mail.gmail.com
Whole thread Raw
In response to after application close MS Visual C++ runtime library error occurs  (Peter Irbizon <peterirbizon@gmail.com>)
Responses Re: after application close MS Visual C++ runtime library error occurs  (Peter Irbizon <peterirbizon@gmail.com>)
List psycopg
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
pygtk.require("2.0")
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
cur.close()
conn.close()
 
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.erickson@stickpeople.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?

-jason

 

psycopg by date:

Previous
From: Jason Horning
Date:
Subject: Re: import error undefined symbol: PyUnicodeUCS2_Decode
Next
From: Peter Irbizon
Date:
Subject: Re: after application close MS Visual C++ runtime library error occurs