Skip to content

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

@gitclem

Description

@gitclem

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue described a bugdifficulty mediumMedium issue: required good gensim understanding & python skillsgood first issueIssue for new contributors (not required gensim understanding + very simple)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions