Skip to content

Commit

Permalink
Merge pull request #128 from pierotofy/dofix
Browse files Browse the repository at this point in the history
Fix download_edgar_data
  • Loading branch information
dgunning authored Oct 25, 2024
2 parents ffbd5e8 + cb613f5 commit f3dcd3b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions edgar/httprequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,9 @@ async def download_bulk_data(data_url: str) -> Path:
if not download_path.exists():
download_path.mkdir()

as_text = data_url.endswith('.zip')

if filename.endswith(".zip"):
# Now stream the file to the data directory
await stream_file(data_url, as_text=as_text, path=download_path)
await stream_file(data_url, path=download_path)
# Unzip the file to the data directory / file
with zipfile.ZipFile(download_filename, 'r') as z:
z.extractall(download_path)
Expand Down

0 comments on commit f3dcd3b

Please sign in to comment.