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') |         openssh_pubkey_str = self.data.get('public_key') | ||||||
| 
 | 
 | ||||||
|         with tempfile.NamedTemporaryFile(delete=True) as tmp_public_key_file: |         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() |             tmp_public_key_file.flush() | ||||||
|             try: |             try: | ||||||
|                 out = subprocess.check_output( |                 out = subprocess.check_output( | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue