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

Problem opening 'data/text_prepare_tests.tsv' file #2

Closed
mpizosdim opened this issue Jan 23, 2018 · 3 comments
Closed

Problem opening 'data/text_prepare_tests.tsv' file #2

mpizosdim opened this issue Jan 23, 2018 · 3 comments

Comments

@mpizosdim
Copy link

mpizosdim commented Jan 23, 2018

Using the docker container environment I am getting a UnicodeDecodeError. More speciffically:

prepared_questions = []
for line in open('data/text_prepare_tests.tsv'):
     line = text_prepare(line.strip())
     prepared_questions.append(line)
text_prepare_results = '\n'.join(prepared_questions)
grader.submit_tag('TextPrepare', text_prepare_results)

Is giving the following error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 79: ordinal not in range(128)

In order to run it I had to change it to:

prepared_questions = []
for line in open('data/text_prepare_tests.tsv', encoding='utf-8'):
     line = text_prepare(line.strip())
     prepared_questions.append(line)
text_prepare_results = '\n'.join(prepared_questions)
grader.submit_tag('TextPrepare', text_prepare_results)

Can also be solved by using pd.read_csv.

Is this error reproducible to anyone else?

@voron13e02
Copy link
Collaborator

Hi! Which Python version do you use?

@mpizosdim
Copy link
Author

@voron13e02 I am running through the docker image provided in the repository.(from the dockerfile i can see its python3).

@voron13e02
Copy link
Collaborator

Fixed.

AVBelyy added a commit to AVBelyy/natural-language-processing-colab that referenced this issue Jul 23, 2019
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

2 participants