Skip site navigation (1) Skip section navigation (2)

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 16:56:01
Message-ID: (view raw, whole thread or download thread mbox)
Lists: psycopg
well, I found out it must be some problem with gtk module.  When I leave
import gtk
import psycopg2
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
> 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

psycopg by date

Next:From: Vojtěch RylkoDate: 2012-01-30 16:09:15
Subject: Named cursor problem
Previous:From: Peter IrbizonDate: 2012-01-17 14:53:51
Subject: Re: after application close MS Visual C++ runtime library error occurs

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group