Skip to content

Fix print formatting on strings that might contain unicode chars#39

Merged
asrivas merged 1 commit intomasterfrom
UnicodeFix
Sep 11, 2018
Merged

Fix print formatting on strings that might contain unicode chars#39
asrivas merged 1 commit intomasterfrom
UnicodeFix

Conversation

@asrivas
Copy link
Copy Markdown
Contributor

@asrivas asrivas commented Sep 11, 2018

If a string has a unicode character such as "Édouard". Print line will throw an error:
Traceback (most recent call last):
File "quickstart.py", line 50, in
main()
File "quickstart.py", line 47, in main
print('{0} ({1})'.format(item['name'], item['id']))

We simply need to change it to: print(u'{0} ({1})'.format(item['name'], item['id']))

*Note, not all .format's in this repo need this change, just ones primarily dealing with user created strings.

@asrivas asrivas merged commit 3c3eefc into master Sep 11, 2018
@grant grant deleted the UnicodeFix branch September 11, 2018 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants