-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
update to use v1 client #1216
update to use v1 client #1216
Conversation
@@ -90,7 +87,7 @@ def index(path, index_file): | |||
print('Failed to process {}'.format(file_path)) | |||
|
|||
with io.open(index_file, 'w', encoding='utf-8') as f: | |||
f.write(json.dumps(result)) | |||
f.write(unicode(json.dumps(result))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unicode doesn't exist on python 3, what you really want here is:
json.dump(result, f)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python 2.7's json.dump seems to use f.write and json.dump(result, f)
still returns the following error:
TypeError: write() argument 1 must be unicode, not str
…ples#1216) * update to use v1 client * set ensure_ascii=False
…ples#1216) * update to use v1 client * set ensure_ascii=False
…ples#1216) * update to use v1 client * set ensure_ascii=False
Update the tutorial to use v1 client. Sample tests passed.