-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: strengthen typing in get_c_string, fix StringHashTable segfault #30419
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
Conversation
buf = PyUnicode_AsUTF8AndSize(py_string, length) | ||
else: | ||
PyBytes_AsStringAndSize(py_string, <char**>&buf, length) | ||
buf = PyUnicode_AsUTF8AndSize(py_string, length) |
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.
Hmm interesting - so I guess this helper function existed in the first place for 2/3 compat? If this is all it is reduced to why not get rid of this function altogether and just replace with PyUnicode_AsUTF8AndSize
?
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.
so I guess this helper function existed in the first place for 2/3
thats my guess, yah.
just replace with PyUnicode_AsUTF8AndSize?
for now at least because we need to figure out what to do about the segfault thing; the imlpementation here might end up changing
lgtm. not sure why the 36 build is failing though. |
Looks like we're passing |
So it isnt a numpy-version problem, just a slow test that is only getting run in that build. We're passing a np.str_ object instead of just a str. This is tough to check for because |
lgtm. |
thanks @jbrockmendel |
Start with util.pxd, we can tighten the arg from "object" to "str" and simplify it a bit. Tracking down the places where get_c_string is used, the main one is in StringHashTable, where in
set_item
it is currently used incorrectly. The test added by this PR segfaults in master.@TomAugspurger it looks like StringHashTable has relatively light testing. Should we be using it for StringArray?