native_main.py: Add ".txt" suffix to temporary file names

Reasons explained in https://github.com/tridactyl/tridactyl/issues/1204

Closes #1204
This commit is contained in:
glacambre 2018-12-12 07:12:49 +01:00
parent 1577a8e32e
commit a56c185935
No known key found for this signature in database
GPG key ID: B9625DB1767553AC

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