Skip to content

Commit

Permalink
fix: adds encoding fix to main
Browse files Browse the repository at this point in the history
  • Loading branch information
a-rampalli committed Jan 29, 2024
1 parent 8f3dc53 commit 05bd897
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@ def download_data(self, url: str, chunk_size: int = 1024) -> tuple[str, str]:
# set filepath for binary data from response
tmp_file = os.path.realpath(os.path.basename(url))
with closing(self._send_http_request("GET", f"{url}/results", stream=True)) as response, open(tmp_file, "wb") as data_file:
response_encoding = response.encoding or self.encoding
self.logger.info(f"Logging encoding values \n actual header: {response.headers} \nresponse.encoding : {response.encoding} \n response.apparent_encoding : {response.apparent_encoding} \n self.encoding : {self.encoding}")
response_encoding = self.encoding
for chunk in response.iter_content(chunk_size=chunk_size):
data_file.write(self.filter_null_bytes(chunk))
# check the file exists
Expand Down

0 comments on commit 05bd897

Please sign in to comment.