Arch: Fixed use of tempfile.mkstemp - fixes #2674

This commit is contained in:
Yorik van Havre
2016-08-16 11:17:45 -03:00
parent 1134ab9747
commit f950486c64
4 changed files with 13 additions and 5 deletions

View File

@@ -282,12 +282,14 @@ class _BimServerTaskPanel:
FreeCAD.Console.PrintMessage(translate("Arch","Opening file...\n"))
self.form.labelStatus.setText(translate("Arch","Opening file..."))
if not tf:
tf = tempfile.mkstemp(suffix=".ifc")[1]
th,tf = tempfile.mkstemp(suffix=".ifc")
f = open(tf,"wb")
f.write(base64.b64decode(downloaddata))
f.close()
os.close(th)
import importIFC
importIFC.open(tf)
os.remove(tf)
self.form.labelStatus.setText("")
def uploadFile(self):