Use pathclass.Path.open.

This commit is contained in:
Ethan Dalool 2020-09-20 18:29:12 -07:00
parent df36ca074d
commit 5d16cd0e3a

View file

@ -299,7 +299,7 @@ def download_stick(id, overwrite=False, extract=False):
response = request(download_link) response = request(download_link)
os.makedirs(directory.absolute_path, exist_ok=True) os.makedirs(directory.absolute_path, exist_ok=True)
with open(filepath.absolute_path, 'wb') as handle: with filepath.open('wb') as handle:
handle.write(response.content) handle.write(response.content)
if extract and filepath.extension == 'zip': if extract and filepath.extension == 'zip':