Re: [Python-Dev] Unload a module written in C

2011-03-25 Thread Martin v. Löwis
Am 25.03.2011 10:24, schrieb Stefan Behnel: > "Martin v. Löwis", 25.03.2011 07:59: >>> Is there a bug somewhere, or do I misunderstood something important? >> >> Module unloading is simply not implemented, and would be very difficult >> to implement. > > Are you saying that because objects instant

Re: [Python-Dev] Unload a module written in C

2011-03-25 Thread Martin v. Löwis
Am 25.03.2011 11:14, schrieb Victor Stinner: > Le vendredi 25 mars 2011 à 07:59 +0100, "Martin v. Löwis" a écrit : >>> Is there a bug somewhere, or do I misunderstood something important? >> >> Module unloading is simply not implemented, and would be very difficult >> to implement. > > My problem

Re: [Python-Dev] Unload a module written in C

2011-03-25 Thread Nick Coghlan
On Fri, Mar 25, 2011 at 9:36 PM, Victor Stinner wrote: >> And registering your cleanup function with atexit() isn't enough? Or >> does that remove the handler too early? > > atexit() is too late: when Python is embeded, Py_Finalize() may be > called a long time before the program does really finis

Re: [Python-Dev] Unload a module written in C

2011-03-25 Thread Victor Stinner
Le vendredi 25 mars 2011 à 21:14 +1000, Nick Coghlan a écrit : > On Fri, Mar 25, 2011 at 8:14 PM, Victor Stinner > wrote: > > Le vendredi 25 mars 2011 à 07:59 +0100, "Martin v. Löwis" a écrit : > >> > Is there a bug somewhere, or do I misunderstood something important? > >> > >> Module unloading i

Re: [Python-Dev] Unload a module written in C

2011-03-25 Thread Nick Coghlan
On Fri, Mar 25, 2011 at 8:14 PM, Victor Stinner wrote: > Le vendredi 25 mars 2011 à 07:59 +0100, "Martin v. Löwis" a écrit : >> > Is there a bug somewhere, or do I misunderstood something important? >> >> Module unloading is simply not implemented, and would be very difficult >> to implement. > >

Re: [Python-Dev] Unload a module written in C

2011-03-25 Thread Victor Stinner
Le vendredi 25 mars 2011 à 07:59 +0100, "Martin v. Löwis" a écrit : > > Is there a bug somewhere, or do I misunderstood something important? > > Module unloading is simply not implemented, and would be very difficult > to implement. My problem is that if Python is embeded, my module will still be

Re: [Python-Dev] Unload a module written in C

2011-03-25 Thread Victor Stinner
Le vendredi 25 mars 2011 à 10:24 +0100, Stefan Behnel a écrit : > "Martin v. Löwis", 25.03.2011 07:59: > >> Is there a bug somewhere, or do I misunderstood something important? > > > > Module unloading is simply not implemented, and would be very difficult > > to implement. > > Are you saying that

Re: [Python-Dev] Unload a module written in C

2011-03-25 Thread Stefan Behnel
"Martin v. Löwis", 25.03.2011 07:59: Is there a bug somewhere, or do I misunderstood something important? Module unloading is simply not implemented, and would be very difficult to implement. Are you saying that because objects instantiated from a module do not normally keep a reference to i

Re: [Python-Dev] Unload a module written in C

2011-03-25 Thread Martin v. Löwis
> Is there a bug somewhere, or do I misunderstood something important? Module unloading is simply not implemented, and would be very difficult to implement. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

[Python-Dev] Unload a module written in C

2011-03-24 Thread Victor Stinner
Hi, I am trying to understand why I am unable to unload my faulthandler module (implemented in C). Antoine pointed me _PyImport_FixupExtensionObject() comment which gave me a first clue: Modules which do support multiple initialization set their m_size field to a non-negative number (indica