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

Receive const char * from PyUnicode_AsUTF8 #451

Merged
merged 1 commit into from
Oct 19, 2018

Conversation

jakirkham
Copy link
Contributor

In Python 3.7, PyUnicode_AsUTF8 was changed to return a const char * instead of a char *. This broke VIGRA as we were accepting a char * in this case instead. Fortunately we do not need it to be mutable for our use case. So just type the variable storing the result from PyUnicode_AsUTF8 as a const char *. Should still work on older Python 3 versions that return char * as well.

xref: #450
ref: https://bugs.python.org/issue28769

In Python 3.7, `PyUnicode_AsUTF8` was changed to return a `const char *`
instead of a `char *`. This broke VIGRA as we were accepting a `char *`
in this case instead. Fortunately we do not need it to be mutable for
our use case. So just type the variable storing the result from
`PyUnicode_AsUTF8` as a `const char *`. Should still work on older
Python 3 versions that return `char *` as well.

ref: https://bugs.python.org/issue28769
@ukoethe ukoethe merged commit 8acd73a into ukoethe:master Oct 19, 2018
@jakirkham jakirkham deleted the fix_py37_unicode_conv_bug branch October 19, 2018 16:12
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