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 utf-8 error on py 2.7 #7

Merged

Conversation

Globegitter
Copy link

On our pre-production environment we just now got an error related to unicode encoding in the to_global_id code. I fixed it and added a test that ensures that behaviour works.

As a reference, this is the error one would see otherwise:

  File "/home/app/apps/killik_ops_dashboard.pex/third_party/python/graphql_relay/node/node.py", line 53, in to_global_id
    return base64(':'.join([type, str(id)]))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u06ed' in position 39: ordinal not in range(128)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 99.623% when pulling 71fe343 on Globegitter:to-global-id-unicode-error into c4c6533 on graphql-python:master.

@coveralls
Copy link

coveralls commented Nov 18, 2016

Coverage Status

Coverage increased (+0.007%) to 99.623% when pulling 3b4de4f on Globegitter:to-global-id-unicode-error into c4c6533 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 99.62% when pulling 7a5ded4 on Globegitter:to-global-id-unicode-error into c4c6533 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 99.621% when pulling a67d78e on Globegitter:to-global-id-unicode-error into c4c6533 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 99.621% when pulling d852e75 on Globegitter:to-global-id-unicode-error into c4c6533 on graphql-python:master.

@coveralls
Copy link

coveralls commented Nov 18, 2016

Coverage Status

Coverage increased (+0.007%) to 99.623% when pulling c348879 on Globegitter:to-global-id-unicode-error into c4c6533 on graphql-python:master.

@Globegitter
Copy link
Author

This test failure was really strange - it happens to me locally also on master and seems to be a dict ordering consistency issue between py2 and py3. This sorted is not great but was the only way I managed to fix it.

@coveralls
Copy link

coveralls commented Nov 23, 2016

Coverage Status

Coverage increased (+0.02%) to 99.636% when pulling 148575e on Globegitter:to-global-id-unicode-error into c4c6533 on graphql-python:master.

@Globegitter
Copy link
Author

Noticed I did only fix it on the lower level, @syrusakbary is now ready to merge :)

@syrusakbary syrusakbary merged commit 22b2a70 into graphql-python:master Nov 23, 2016
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.

None yet

3 participants