Skip to content

Commit df0f008

Browse files
webparameterbrandon-rhodes
authored andcommitted
Changed all modes from 'wb' to 'w' to make it work for both Python and Python3 (brandon-rhodes#27)
1 parent c1d5dcc commit df0f008

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

build/BUILD.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
split_on_tabs = re.compile(b'\t+').split
1010

11+
1112
def main():
1213
os.chdir(os.path.dirname(os.path.abspath(__file__)))
1314
if not os.path.isdir('../data'):
@@ -53,7 +54,7 @@ def main():
5354

5455
print('Writing "titles.csv"')
5556

56-
with open('../data/titles.csv', 'wb') as f:
57+
with open('../data/titles.csv', 'w') as f:
5758
output = csv.writer(f)
5859
output.writerow(('title', 'year'))
5960
for raw_title in interesting_titles:
@@ -69,7 +70,7 @@ def main():
6970
line = next(lines)
7071
assert next(lines) == b'==================\n'
7172

72-
output = csv.writer(open('../data/release_dates.csv', 'wb'))
73+
output = csv.writer(open('../data/release_dates.csv', 'w'))
7374
output.writerow(('title', 'year', 'country', 'date'))
7475

7576
for line in lines:
@@ -100,7 +101,7 @@ def main():
100101

101102
print('Finished writing "release_dates.csv"')
102103

103-
output = csv.writer(open('../data/cast.csv', 'wb'))
104+
output = csv.writer(open('../data/cast.csv', 'w'))
104105
output.writerow(('title', 'year', 'name', 'type', 'character', 'n'))
105106

106107
for role_type, filename in (
@@ -188,6 +189,7 @@ def not_a_real_movie(line):
188189

189190
match_title = re.compile(r'^(.*) \((\d+)(/[IVXL]+)?\)$').match
190191

192+
191193
def parse_title(raw_title):
192194
try:
193195
title = raw_title.decode('ascii')

0 commit comments

Comments
 (0)