Re: after application close MS Visual C++ runtime library error occurs

From: Peter Irbizon <peterirbizon(at)gmail(dot)com>
To: Jason Erickson <jason(dot)erickson(at)stickpeople(dot)com>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: after application close MS Visual C++ runtime library error occurs
Date: 2012-01-17 14:53:51
Message-ID: CABFuWSz7Yq7sAyM0+RwdPdhAwRJcBo5dfUtEkkAgBfO+wr6VrQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(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?
>
> -jason
>
>
>

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Peter Irbizon 2012-01-17 16:56:01 Re: after application close MS Visual C++ runtime library error occurs
Previous Message Jason Horning 2012-01-16 18:34:26 Re: import error undefined symbol: PyUnicodeUCS2_Decode