Closed hgn closed 7 years ago
def save_snippet(app, mime_type, sha, name, data): f_type = name.split('.')[1] snippet_tmp_path = os.path.join('/tmp', 'tmp{}.{}'.format(sha, f_type)) # snippet_tmp_path = os.path.join(tmp_path, name) data_decoded = hippod.hasher.decode_base64_data(data) data_decoded = data_decoded.decode('utf-8') with open(snippet_tmp_path, 'w') as file: file.write(data_decoded) return snippet_tmp_path
name.split will crash when name is not foo.png, whatever, but it should also be ok to be just foo.
name.split will crash when name is not foo.png, whatever, but it should also be ok to be just foo.