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

Fixed download.py (Empty file downloads, encoding errors) #65

Merged
merged 1 commit into from
Jul 11, 2017

Conversation

shreyaspadhy
Copy link
Contributor

@shreyaspadhy shreyaspadhy commented Jul 4, 2017

Fixed the following errors -

  1. Python defaulting to ASCII encoding instead of Unicode.
    Set global encoding to "utf-8"
  2. Script downloading 0kb empty FILE objects.
    Some filenames being generated contained ":", which is a restricted
    character in filenames on Windows and MacOS and was truncating filenames
    before the extension, added to the replacements list in clean_text.
  3. Download failures.
    Used the requests library to improve success rates of downloads, which
    seemed to work a bit better.

Fixed the following errors -
1. Python defaulting to ASCII encoding instead of Unicode.
Set global encoding to "utf-8"
2. Sript downloading 0kb empty FILE objects.
Some files being generated contained ":", which is a restricted
character in filenames on Windows and MacOS and was truncating filenames
before the extension, added to the replacements list in clean_text.
3.  Download failures.
Used the requests library to improve success rates of downloads, which
seemed to work a bit better.
@floodsung floodsung merged commit 47a7e9a into floodsung:master Jul 11, 2017
@zeyu42
Copy link

zeyu42 commented Jul 15, 2017

To run the script in Python 3, one has to remove the line import urllib2 and the encoding settings.

@shreyaspadhy
Copy link
Contributor Author

Does Python 3 automatically encode in Unicode then? I"ll make a few changes to make sure it works in Python 3, thanks

@zeyu42
Copy link

zeyu42 commented Jul 15, 2017

Yes. BTW thanks for this wonderful repo!

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

Successfully merging this pull request may close these issues.

3 participants