Commit 1f008b65 authored by Aurel's avatar Aurel

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
parent 68bc3bf5
...@@ -38,7 +38,7 @@ from Globals import InitializeClass, DTMLFile, PersistentMapping ...@@ -38,7 +38,7 @@ from Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.Tool.BaseTool import BaseTool from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from Products.ERP5.Document.BusinessTemplate import TemplateConditionError from Products.ERP5.Document.BusinessTemplate import TemplateConditionError
from tempfile import mkstemp from tempfile import mkstemp, mkdtemp
from Products.ERP5 import _dtmldir from Products.ERP5 import _dtmldir
from OFS.Traversable import NotFound from OFS.Traversable import NotFound
from difflib import unified_diff from difflib import unified_diff
...@@ -143,8 +143,7 @@ class TemplateTool (BaseTool): ...@@ -143,8 +143,7 @@ class TemplateTool (BaseTool):
""" """
path = business_template.getTitle() path = business_template.getTitle()
path = pathname2url(path) path = pathname2url(path)
tmpfile_path = os.tmpnam() tmpdir_path = mkdtemp()
tmpdir_path = os.path.dirname(tmpfile_path)
current_directory = os.getcwd() current_directory = os.getcwd()
os.chdir(tmpdir_path) os.chdir(tmpdir_path)
export_string = business_template.export(path=path) export_string = business_template.export(path=path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment