Explorar o código

wxGUI/render: attempt to fix not deleting temporary files, https://trac.osgeo.org/grass/ticket/560 (merge from trunk, https://trac.osgeo.org/grass/changeset/60947)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@61090 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová %!s(int64=10) %!d(string=hai) anos
pai
achega
cc1e3ae71f
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      gui/wxpython/core/render.py

+ 4 - 1
gui/wxpython/core/render.py

@@ -77,7 +77,10 @@ class Layer(object):
             else:
                 tempfile_sfx = ".ppm"
 
-            self.mapfile = tempfile.mkstemp(suffix = tempfile_sfx)[1]
+            mapfile = tempfile.NamedTemporaryFile(suffix=tempfile_sfx, delete=False)
+            # we don't want it open, we just need the name
+            self.mapfile = mapfile.name
+            mapfile.close()
             self.maskfile = self.mapfile.rsplit(".",1)[0] + ".pgm"
         else:
             self.mapfile = self.maskfile = None