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

open('aclImdb/alldata-id.txt', encoding='utf-8') doesn't work in Python 2.x #1789

Closed
gitclem opened this issue Dec 15, 2017 · 5 comments
Closed
Labels
bug Issue described a bug difficulty medium Medium issue: required good gensim understanding & python skills good first issue Issue for new contributors (not required gensim understanding + very simple)

Comments

@gitclem
Copy link

gitclem commented Dec 15, 2017

In file doc2vec-IMDB.ipynb, this statement is not supported in Python 2.x but is in Python 3.x

with open('aclImdb/alldata-id.txt', encoding='utf-8') as alldata:

This works in Python 2.7:

import codecs
with codecs.open('aclImdb/alldata-id.txt', encoding='utf-8') as alldata:

@menshikh-iv
Copy link
Contributor

menshikh-iv commented Dec 15, 2017

Thanks for report @gitclem, need to replace all open calls to smart_open in notebooks to avoid this problem (encoding argument appeared only in python3).

@menshikh-iv menshikh-iv added bug Issue described a bug good first issue Issue for new contributors (not required gensim understanding + very simple) difficulty medium Medium issue: required good gensim understanding & python skills labels Dec 15, 2017
@sharanry
Copy link
Contributor

hey, I am new here. Can i take this up?

@menshikh-iv
Copy link
Contributor

@sharanry of course, feel free to contribute 👍

@vasu-dev
Copy link

hey ,
what the progress on the issue, is no one is working i'll like to take this up.

@menshikh-iv
Copy link
Contributor

@vasu-dev this is almost done (in more global #1812), there's nothing more to do here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue described a bug difficulty medium Medium issue: required good gensim understanding & python skills good first issue Issue for new contributors (not required gensim understanding + very simple)
Projects
None yet
Development

No branches or pull requests

4 participants