Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Conversation

ddfisher
Copy link
Collaborator

@ddfisher ddfisher commented Apr 6, 2017

This lets typed_ast run on debug-mode Python. I believe this also a minor correctness fix.

Verified

This commit was signed with the committer’s verified signature.
heitorlessa Heitor Lessa
@ddfisher ddfisher merged commit e231f9b into master Apr 7, 2017
@ddfisher ddfisher deleted the fix-unicode-error branch April 7, 2017 00:43
ddfisher added a commit that referenced this pull request Apr 7, 2017

Verified

This commit was signed with the committer’s verified signature.
heitorlessa Heitor Lessa
@gvanrossum
Copy link
Member

This doesn't look correct. PyUnicode_AsUTF8String() returns a PyObject *, not a C string (https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_AsUTF8String), so you're casting an object to (char *) which is then treated as a C string by forbidden_check(). So then the latter will always return 1.

The original code used PyBytes_AS_STRING() which does return a C string.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants