Issue1637931

classification
Title: Patch for [ 448398 ] open(\'test.txt\',\'w\').write(\'test\'
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, leouserz
Priority: normal Keywords: patch

Created on 2007-01-17.18:00:17 by leouserz, last changed 2007-04-23.03:45:59 by cgroves.

Files
File name Uploaded Description Edit Remove
PyFileDiff.txt leouserz, 2007-01-17.18:00:17 PyFile diff
testwrite.py leouserz, 2007-01-17.18:01:09 new test
Messages
msg2625 (view) Author: Deleted User leouserz (leouserz) Date: 2007-01-17.18:00:17
Attached is a patch for:
http://sourceforge.net/tracker/index.php?func=detail&aid=448398&group_id=12867&atid=112867

and a test case that covers these situations:
1. Garbage collection/finalization close
2. Regular close
3. Shutdown time, close out open PyFiles

The patch is structured in way that allows finalization of PyFiles but also allows other mechanisms to close it down.  The results I see are files being populated with their data.  Which is especially important in situations 1 and 3.

The weak link is if the runtime security is configured so that shutdown hooks can't be added.  But alas what else is there to attempt to shutdown?  Ive stayed away from runFinalizationOnExit since it is deprecated and according to the documentation, unsafe.

leouser
msg2626 (view) Author: Deleted User leouserz (leouserz) Date: 2007-01-17.18:01:11
attaching test.
File Added: testwrite.py
msg2627 (view) Author: Charlie Groves (cgroves) Date: 2007-04-23.03:45:59
Committed in r3178.  
History
Date User Action Args
2007-01-17 18:00:17leouserzcreate