Merge pull request #1228 from glacambre/fix_1204

native_main.py: Add ".txt" suffix to temporary file names
This commit is contained in:
Oliver Blanthorn 2018-12-12 12:39:12 +00:00 committed by GitHub
commit 255602ba6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -477,7 +477,7 @@ def handleMessage(message):
prefix = ""
prefix = "tmp_{}_".format(sanitizeFilename(prefix))
(handle, filepath) = tempfile.mkstemp(prefix=prefix)
(handle, filepath) = tempfile.mkstemp(prefix=prefix, suffix=".txt")
with os.fdopen(handle, "w") as file:
file.write(message["content"])
reply["content"] = filepath