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

Fix encoding on Windows #10

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ch04/imports/movielens/import_movielens.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, argv):

def import_movies(self, file):
print("import movies")
with open(file, 'r+') as in_file:
with open(file, 'r+', encoding='utf-8') as in_file:
reader = csv.reader(in_file, delimiter=',')
next(reader, None)
with self._driver.session() as session:
Expand Down Expand Up @@ -57,7 +57,7 @@ def import_movies(self, file):

def import_movie_details(self, file):
print("Importing details of movies")
with open(file, 'r+') as in_file:
with open(file, 'r+', encoding='utf-8') as in_file:
reader = csv.reader(in_file, delimiter=',')
next(reader, None)
with self._driver.session() as session:
Expand Down Expand Up @@ -127,7 +127,7 @@ def process_movie_info(self, tx, movie_info, movie_id):
"writers": writers, "producers": producers})

def import_user_item(self, file):
with open(file, 'r+') as in_file:
with open(file, 'r+', encoding='utf-8') as in_file:
reader = csv.reader(in_file, delimiter=',')
next(reader, None)
with self._driver.session() as session:
Expand Down
6 changes: 3 additions & 3 deletions ch04/imports/movielens/import_movielens_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, argv):
self._print_lock = threading.Lock()

def import_movies(self, file):
with open(file, 'r+') as in_file:
with open(file, 'r+', encoding='utf-8') as in_file:
reader = csv.reader(in_file, delimiter=',')
next(reader, None)
with self._driver.session() as session:
Expand Down Expand Up @@ -56,7 +56,7 @@ def import_movies(self, file):
print(j, "lines processed")

def import_user_item(self, file):
with open(file, 'r+') as in_file:
with open(file, 'r+', encoding='utf-8') as in_file:
reader = csv.reader(in_file, delimiter=',')
next(reader, None)
with self._driver.session() as session:
Expand Down Expand Up @@ -94,7 +94,7 @@ def import_user_item(self, file):
print(j, "lines processed")

def import_movie_details(self, file):
with open(file, 'r+') as in_file:
with open(file, 'r+', encoding='utf-8') as in_file:
reader = csv.reader(in_file, delimiter=',')
next(reader, None)
with self._driver.session() as session:
Expand Down