From 1f008b65d7d307dbe701ded7e274ff4c3a2b672b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com> Date: Wed, 14 Dec 2005 17:15:34 +0000 Subject: [PATCH] use mkdtmp instead of tmpnam which is deprecated to create tmp folder git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4657 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Tool/TemplateTool.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/product/ERP5/Tool/TemplateTool.py b/product/ERP5/Tool/TemplateTool.py index 18f805061e..dc2e11eedf 100755 --- a/product/ERP5/Tool/TemplateTool.py +++ b/product/ERP5/Tool/TemplateTool.py @@ -38,7 +38,7 @@ from Globals import InitializeClass, DTMLFile, PersistentMapping from Products.ERP5Type.Tool.BaseTool import BaseTool from Products.ERP5Type import Permissions from Products.ERP5.Document.BusinessTemplate import TemplateConditionError -from tempfile import mkstemp +from tempfile import mkstemp, mkdtemp from Products.ERP5 import _dtmldir from OFS.Traversable import NotFound from difflib import unified_diff @@ -143,8 +143,7 @@ class TemplateTool (BaseTool): """ path = business_template.getTitle() path = pathname2url(path) - tmpfile_path = os.tmpnam() - tmpdir_path = os.path.dirname(tmpfile_path) + tmpdir_path = mkdtemp() current_directory = os.getcwd() os.chdir(tmpdir_path) export_string = business_template.export(path=path) -- 2.30.9