We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb8dde2 commit 12b0b4fCopy full SHA for 12b0b4f
1 file changed
qrexec/tools/qubes_policy_editor.py
@@ -25,9 +25,11 @@
25
26
from __future__ import print_function
27
import argparse
28
+import os
29
import subprocess
30
import sys
31
import tempfile
32
+
33
from ..policy.admin_client import PolicyClient
34
from ..policy.admin import (
35
PolicyAdminException,
@@ -90,7 +92,7 @@ def manage_policy(self) -> None:
90
92
sys.exit(1)
91
93
94
# pylint: disable=consider-using-with
- tmpfile = tempfile.NamedTemporaryFile(suffix=suffix)
95
+ tmpfile = tempfile.NamedTemporaryFile(suffix=suffix, delete=False)
96
97
if file_exists:
98
with open(tmpfile.name, "w", encoding="utf-8") as current_file:
@@ -122,6 +124,7 @@ def manage_policy(self) -> None:
122
124
123
125
126
tmpfile.close()
127
+ os.remove(self.tmpfile_name)
128
129
def get_reply(self) -> None:
130
"""
0 commit comments