Opened 16 years ago

Closed 16 years ago

#7339 closed (fixed)

Relying on __del__ being run immediately after del a

Reported by: Maciej Fijalkowski Owned by: nobody
Component: Uncategorized Version: dev
Severity: Keywords:
Cc: fijall@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

A patch for calling gc.collect here and there in tests, not to rely on gc being refcounting.

Attachments (3)

django.diff (1.7 KB ) - added by Maciej Fijalkowski 16 years ago.
test_dispatcher_jython_gc_v2.patch (1.5 KB ) - added by Leo Soto M. 16 years ago.
patch which also works with jython
7339_test_dispatcher_gc_fix.diff (1.9 KB ) - added by Leo Soto M. 16 years ago.
Fixed a mistake I made on the previous patch

Download all attachments as: .zip

Change History (8)

by Maciej Fijalkowski, 16 years ago

Attachment: django.diff added

comment:1 by Jacob, 16 years ago

Resolution: wontfix
Status: newclosed

You need to read more about how __del__ works in Python. The way it works is by design, and we're not going to engage in GC tricks to try to make it act like it does in other languages.

comment:2 by Jacob, 16 years ago

Resolution: wontfix
Status: closedreopened
Triage Stage: UnreviewedAccepted

Nope, I need to read more about how del works in other Python implementations -- PyPy needs this to make the test pass. Thanks for setting me straight, fijal.

by Leo Soto M., 16 years ago

patch which also works with jython

comment:3 by Leo Soto M., 16 years ago

Oh, I didn't see this ticket when filling #7440. I marked that as duplicate and uploaded a new patch here, which should work for Jython and PyPy too.

[Yep, the GC in Java is more tricky :( ]

by Leo Soto M., 16 years ago

Fixed a mistake I made on the previous patch

comment:4 by Maciej Fijalkowski, 16 years ago

Cc: fijall@… added

comment:5 by Russell Keith-Magee, 16 years ago

Resolution: fixed
Status: reopenedclosed

(In [8004]) Fixed #7339 -- Added manual calls to the garbage collector. This is required for PyPy and Jython; these implementations don't use reference counting, so you can't rely on del being run immediately after del is called. Thanks to Maciej Fijalkowski (fijal) and Leo Soto.

Note: See TracTickets for help on using tickets.
Back to Top