Commit 6b44f261 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

[refactor] #342855: replace uses of (deprecated) mktemp

parent 6f065b366d14
......@@ -11,7 +11,7 @@ __docformat__ = "restructuredtext en"
import sys
import os
import logging
from tempfile import mktemp
import tempfile
from os.path import exists, join, basename, splitext
from logilab.common.decorators import cached
......@@ -337,7 +337,7 @@ type "exit" or Ctrl-D to quit the shell and resume operation"""
configfile = self.config.main_config_file()
if self._option_changes:
read_old_config(self.config, self._option_changes, configfile)
newconfig = mktemp()
newconfig = mkstemp()
for optdescr in self._option_changes:
if optdescr[0] == 'added':
optdict = self.config.get_option_def(optdescr[1])
......
......@@ -254,13 +254,12 @@ class UpdateCubicWebCatalogCommand(Command):
if args:
raise BadCommandUsage('Too much arguments')
import shutil
from tempfile import mktemp
import tempfile
import yams
from logilab.common.fileutils import ensure_fs_mode
from logilab.common.shellutils import globfind, find, rm
from cubicweb.common.i18n import extract_from_tal, execute
tempdir = mktemp()
mkdir(tempdir)
tempdir = tempdir.mkdtemp()
potfiles = [join(I18NDIR, 'entities.pot')]
print '******** extract schema messages'
schemapot = join(tempdir, 'schema.pot')
......@@ -348,14 +347,13 @@ def update_cubes_catalogs(cubes):
def update_cube_catalogs(cubedir):
import shutil
from tempfile import mktemp
import tempfile
from logilab.common.fileutils import ensure_fs_mode
from logilab.common.shellutils import find, rm
from cubicweb.common.i18n import extract_from_tal, execute
toedit = []
cube = basename(normpath(cubedir))
tempdir = mktemp()
mkdir(tempdir)
tempdir = tempfile.mkdtemp()
print '*' * 72
print 'updating %s cube...' % cube
chdir(cubedir)
......
......@@ -649,7 +649,7 @@ class DBCopyCommand(Command):
import tempfile
srcappid = pop_arg(args, 1, msg="No source application specified !")
destappid = pop_arg(args, msg="No destination application specified !")
output = tempfile.mktemp()
output = tempfile.mkstemp()
if ':' in srcappid:
host, srcappid = srcappid.split(':')
_remote_dump(host, srcappid, output, self.config.sudo)
......
......@@ -8,7 +8,6 @@
import sys
import os
from os.path import dirname, join, abspath
from tempfile import mktemp
from logilab.common.testlib import TestCase, unittest_main
from logilab.common.changelog import Version
......
......@@ -8,7 +8,7 @@
__docformat__ = "restructuredtext en"
import os
from tempfile import mktemp
import tempfile
from rql import nodes
......@@ -109,7 +109,7 @@ class TmpFileViewMixin(object):
def cell_call(self, row=0, col=0):
self.row, self.col = row, col # in case one need it
tmpfile = mktemp('.png')
tmpfile = tempfile.mkstemp('.png')
try:
self._generate(tmpfile)
self.w(open(tmpfile).read())
......
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