Skip to content

Commit

Permalink
Remove unnecessary quotes around export filename
Browse files Browse the repository at this point in the history
  • Loading branch information
neumark committed Dec 19, 2022
1 parent b205de8 commit 83b5047
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion splitgraph/commandline/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ def download_file(url: str, filename: Optional[str]) -> None:
from tqdm import tqdm

response = requests.get(url, stream=True)

if not filename and "Content-Disposition" in response.headers:
filename = re.findall("filename=(.+)", response.headers["Content-Disposition"])[0]
filename = re.findall('filename="(.+)"', response.headers["Content-Disposition"])[0]
if not filename:
filename = urlparse(url).path.split("/")[-1]
with open(filename, "wb") as f:
Expand Down

0 comments on commit 83b5047

Please sign in to comment.