Writing bytes to NamedTemporaryFile
This commit is contained in:
parent
261615e701
commit
3770489a49
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ class UserHostingKeyForm(forms.ModelForm):
|
|||
openssh_pubkey_str = self.data.get('public_key')
|
||||
|
||||
with tempfile.NamedTemporaryFile(delete=True) as tmp_public_key_file:
|
||||
tmp_public_key_file.writelines(openssh_pubkey_str)
|
||||
tmp_public_key_file.write(openssh_pubkey_str.encode('utf-8'))
|
||||
tmp_public_key_file.flush()
|
||||
try:
|
||||
out = subprocess.check_output(
|
||||
|
|
Loading…
Reference in a new issue