[Zope-CVS] CVS: Products/ExternalEditor - zopeedit.py:1.49

Casey Duncan casey at zope.com
Mon Jul 12 17:16:40 EDT 2004


Update of /cvs-repository/Products/ExternalEditor
In directory cvs.zope.org:/tmp/cvs-serv31788

Modified Files:
	zopeedit.py 
Log Message:
Make sure file removal in __del__ is tolerant of failures. Windows will prevent zopeedit from removing the original temp file on some versions.
On windows import the Plugins pkg to make sure py2exe picks up the dependancy and includes it


=== Products/ExternalEditor/zopeedit.py 1.48 => 1.49 ===
--- Products/ExternalEditor/zopeedit.py:1.48	Wed Jul  7 16:00:11 2004
+++ Products/ExternalEditor/zopeedit.py	Mon Jul 12 17:16:39 2004
@@ -186,7 +186,10 @@
     def __del__(self):
         if getattr(self, 'clean_up', 1) and hasattr(self, 'content_file'):
             # for security we always delete the files by default
-            os.remove(self.content_file)
+	    try:
+                os.remove(self.content_file)
+            except OSError:
+                pass     
 
         if self.did_lock:
             # Try not to leave dangling locks on the server
@@ -544,6 +547,7 @@
 ## Platform specific declarations ##
 
 if win32:
+    import Plugins # Assert dependancy
     from win32ui import MessageBox
     from win32process import CreateProcess, GetExitCodeProcess, STARTUPINFO
     from win32event import WaitForSingleObject



More information about the Zope-CVS mailing list