Re: [pygtk] PyGTK object escapes garbage collection

2010-12-24 Thread Gerald Britton
On Fri, Dec 24, 2010 at 5:28 AM, Hrvoje Niksic  wrote:
> The problem you describe sounds like it might be related to this infamous
> PyGTK bug:
>
> https://bugzilla.gnome.org/show_bug.cgi?id=546802
>
> In our tests the problems show up when a Python object that participates in
> a cycle is referenced only through a GTK widget.  When GC takes place,
> Python's cycle-breaker incorrectly concludes that the whole cycle is
> unreachable and runs tp_clear on all objects.  The objects are, of course,
> still reachable through PyGTK, and unfortunately now quite broken.
>
> A number of workarounds are available: simply access the widget's __dict__,
> which forces it to switch to a different reference-counting strategy.  Or
> store a reference to your object in a global variable or container.

To me, this is clearly a pygtk bug.  It should not be creating cycles
like this.  Also, it can create cycles without your participation.  If
you use builder, it can find callbacks using introspection.  I have
some modules that use introspection and have a few "connect" calls as
well.  To have to do all the introspection yourself in your own
modules is ridiculous.



> ___
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>



-- 
Gerald Britton
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] PyGTK object escapes garbage collection

2010-12-24 Thread Hrvoje Niksic
The problem you describe sounds like it might be related to this 
infamous PyGTK bug:


https://bugzilla.gnome.org/show_bug.cgi?id=546802

In our tests the problems show up when a Python object that participates 
in a cycle is referenced only through a GTK widget.  When GC takes 
place, Python's cycle-breaker incorrectly concludes that the whole cycle 
is unreachable and runs tp_clear on all objects.  The objects are, of 
course, still reachable through PyGTK, and unfortunately now quite broken.


A number of workarounds are available: simply access the widget's 
__dict__, which forces it to switch to a different reference-counting 
strategy.  Or store a reference to your object in a global variable or 
container.

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] PyGTK object escapes garbage collection

2010-12-24 Thread Pierre

Thanks for your answers Gerald.


   button.connect("clicked", weakref.proxy(self.hello))


Well, I get this when I click the button:

   ReferenceError: weakly-referenced object no longer exists

That's surprising too, since the hello() method of "page" certainly does 
exist until "page" gets unreachable... and, at the time I click, "page" 
can be reached through the notebook.get_nth_page() method.


Unfortunately, I'm not familiar enough with how the Python and the 
GObject reference counting systems interact to understand what's going on.


I will wait for more answers, then submit a bug report.

Cheers,
Pierre
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] ANNOUNCE: PyGTK All-in-one Installer 2.22.5

2010-12-24 Thread Tim Lebedkov
thank you. That's great!

On Fri, Dec 24, 2010 at 10:05 AM, Dieter Verfaillie
 wrote:
> On 24/12/2010 09:44, Tim Lebedkov wrote:
>> thank you for the effort. I use the installers from
>> http://www.optionexplicit.be/projects/gnome-windows/20101102/ in
>> Npackd. Is it the right location?
>
> I keep everything on optionexplicit.be available as long as
> possible, but sometimes I need to remove older files (due to
> resource constraints). The good news is that all installers
> from the 20101102 directory are are now also hosted on
> http://download.gnome.org:
>
> PyGTK (as the pygtk-2.22.0-1 revision):
>    http://download.gnome.org/binaries/win32/pygtk/2.22/
>
> PyGObject (as the pygobject-2.26.0-1 revision):
>    http://download.gnome.org/binaries/win32/pygobject/2.26/
>
> PyCairo:
>    http://download.gnome.org/binaries/win32/pycairo/1.8/
>
> PyGooCanvas:
>    http://download.gnome.org/binaries/win32/pygoocanvas/0.14/
>
> PyGtkSourceView2:
>    http://download.gnome.org/binaries/win32/pygtksourceview/2.10/
>
> PyRsvg:
>    http://download.gnome.org/binaries/win32/gnome-python-desktop/2.32/
>
>> Will you still provide installers
>> for single libraries?
>
> Yes. Be assured the separate installers are not going away, they
> are even a requirement to build the all-in-one installer.
>
> mvg,
> Dieter
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] ANNOUNCE: PyGTK All-in-one Installer 2.22.5

2010-12-24 Thread Alessandro Dentella
On Fri, Dec 24, 2010 at 06:55:56AM +0100, Dieter Verfaillie wrote:
> We are pleased to announce release 2.22.5 of the PyGTK All-in-one
> installer for Windows.

Thanks Dieter! I strongly believe that this is a great boost in PyGTK
adoption and diffusion. A very nice christmas gift!


sandro
*:-)


-- 
Sandro Dentella  *:-)
http://www.reteisi.org Soluzioni libere per le scuole
http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] ANNOUNCE: PyGTK All-in-one Installer 2.22.5

2010-12-24 Thread Dieter Verfaillie
On 24/12/2010 09:44, Tim Lebedkov wrote:
> thank you for the effort. I use the installers from
> http://www.optionexplicit.be/projects/gnome-windows/20101102/ in
> Npackd. Is it the right location?

I keep everything on optionexplicit.be available as long as
possible, but sometimes I need to remove older files (due to
resource constraints). The good news is that all installers
from the 20101102 directory are are now also hosted on
http://download.gnome.org:

PyGTK (as the pygtk-2.22.0-1 revision):
http://download.gnome.org/binaries/win32/pygtk/2.22/

PyGObject (as the pygobject-2.26.0-1 revision):
http://download.gnome.org/binaries/win32/pygobject/2.26/

PyCairo:
http://download.gnome.org/binaries/win32/pycairo/1.8/

PyGooCanvas:
http://download.gnome.org/binaries/win32/pygoocanvas/0.14/

PyGtkSourceView2:
http://download.gnome.org/binaries/win32/pygtksourceview/2.10/

PyRsvg:
http://download.gnome.org/binaries/win32/gnome-python-desktop/2.32/

> Will you still provide installers
> for single libraries?

Yes. Be assured the separate installers are not going away, they
are even a requirement to build the all-in-one installer.

mvg,
Dieter
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] ANNOUNCE: PyGTK All-in-one Installer 2.22.5

2010-12-24 Thread Tim Lebedkov
Hello Dieter,

thank you for the effort. I use the installers from
http://www.optionexplicit.be/projects/gnome-windows/20101102/ in
Npackd. Is it the right location? Will you still provide installers
for single libraries?

--Tim

On Fri, Dec 24, 2010 at 6:55 AM, Dieter Verfaillie
 wrote:
> We are pleased to announce release 2.22.5 of the PyGTK All-in-one
> installer for Windows.
>
> More information can be found in the README file at:
> https://github.com/dieterv/pygtk-installer#readme
>
> * What is it?
> =
> The PyGTK All-in-one installer provides an alternative installation
> method for PyGTK users on Windows. It bundles PyGTK, PyGObject,
> PyCairo, PyGtkSourceView2, PyGooCanvas, PyRsvg, the gtk+-bundle
> and Glade in one handy installer.
>
> Currently 32 bit Python 2.6 and 2.7 versions are supported
> on Windows XP and up.
>
> Some screenshots can be seen at:
> https://github.com/dieterv/pygtk-installer/wiki
>
> * Where to get it?
> ==
>
> binaries:
>
> http://download.gnome.org/binaries/win32/pygtk/2.22/pygtk-all-in-one-2.22.5.win32-py2.6.msi
>  md5sum    : 3acbd0ef3c13c1112d6f119bdb076ac6
>  size      : 32,3M
>
> http://download.gnome.org/binaries/win32/pygtk/2.22/pygtk-all-in-one-2.22.5.win32-py2.7.msi
>  md5sum    : 7a0272a0bd5c857b994f2eed92af199f
>  size      : 32,3M (33091012)
>
> source code:
>
> https://github.com/dieterv/pygtk-installer/tree/release-2.22.5
> https://github.com/dieterv/pygtk-installer/tarball/release-2.22.5
> https://github.com/dieterv/pygtk-installer/zipball/release-2.22.5
>
>
> Enjoy!
>
> The PyGTK Team
> ___
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/