Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run 'download_reference_data' with 32 bit Python 3 #8

Open
rhowar23 opened this issue Aug 14, 2018 · 0 comments
Open

Unable to run 'download_reference_data' with 32 bit Python 3 #8

rhowar23 opened this issue Aug 14, 2018 · 0 comments

Comments

@rhowar23
Copy link

After a review of 'requests.get(stream=True) will get incomplete data #4227' by Luckasa, I realized that I needed to 'chunk' the file (this issue is due to running large files with 32 bit Python 3). I made the following change to 'download_reference_data', which resolved the problem:

Changed line 93 from:

open(dest, 'wb').write(r.content)

to:

open(dest, 'wb').write(r.content)

            with open(dest, 'wb') as f:
                for chunk in r.iter_content(chunk_size=1024*36):
                    if chunk:
                        f.write(chunk)
                        f.flush()
            r.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant