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

Fixing utf-8 encoding bug #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SampannaKahu
Copy link

Hi,
While running the original file on my system, I get the following error:

Making bin file for URLs listed in url_lists/all_test.txt...
Writing story 0 of 11490; 0.00 percent done
Traceback (most recent call last):
  File "make_datafiles.py", line 256, in <module>
    write_to_tar(all_test_urls, os.path.join(finished_files_dir, "test.tar"))
  File "make_datafiles.py", line 185, in write_to_tar
    article_sents, abstract_sents = get_art_abs(story_file)
  File "make_datafiles.py", line 109, in get_art_abs
    lines = read_story_file(story_file)
  File "make_datafiles.py", line 78, in read_story_file
    contents = f.read()
  File "/home/sampanna/.conda/envs/fast_abs_rl/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 858: ordinal not in range(128)

This PR fixes that.

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.

1 participant