Title: gc.disable() throws "NotImplementedError: can't disable Java GC"
Type: behaviour Severity: minor
Components: Library Versions: 2.5b0
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: colinhevans, otmarhumbel, zyasoft
Priority: Keywords:

Created on 2008-11-20.01:28:31 by colinhevans, last changed 2008-11-21.21:02:00 by zyasoft.

msg3790 (view) Author: Colin Evans (colinhevans) Date: 2008-11-20.01:29:47
gc.disable() throws "NotImplementedError: can't disable Java GC".  Can
it just ignore the call instead in order to maintain compatibility?  

Here's the output when run on PyBench:

* using Python 2.5b0
Traceback (most recent call last):
  File "./", line 938, in <module>
  File "/u/colin/pybench/", line 346, in __init__
    rc = self.main()
  File "./", line 842, in main
NotImplementedError: can't disable Java GC
msg3791 (view) Author: Oti Humbel (otmarhumbel) Date: 2008-11-20.09:15:20
AFAIK there is no way of disabling the garbage collector in Java.
This is documented in the docstring of gc:

>>> import gc
>>> print gc.__doc__
This module provides access to the garbage collector.

enable() -- Enable automatic garbage collection (does nothing).
isenabled() -- Returns True because Java garbage collection cannot be
collect() -- Trigger a Java garbage collection (potentially expensive).
get_debug() -- Get debugging flags (returns 0).

Other functions raise NotImplementedError because they do not apply to Java.

msg3800 (view) Author: Jim Baker (zyasoft) Date: 2008-11-21.21:01:59
gc.disable() is also used in Jython's Lib:
 * - need to fix
 * - apparently this path is not being exercised by, or perhaps it never gets used at all!

In general, we should just fix the offending code, not our gc wrapper,
so I agree in keeping it closed. If we were to have some sort of
compatibility shim, it needs to be of larger scope than just for gc.
Date User Action Args
2008-11-21 21:02:00zyasoftsetnosy: + zyasoft
messages: + msg3800
2008-11-20 09:45:38otmarhumbelsetstatus: open -> closed
resolution: invalid
2008-11-20 09:15:21otmarhumbelsetnosy: + otmarhumbel
messages: + msg3791
2008-11-20 01:29:48colinhevanssetmessages: + msg3790
2008-11-20 01:28:31colinhevanscreate