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
PyString_AsString() segfaults when passed a unicode string #41302
Comments
If you pass a PyObject representation the unicode Famous last words of Python 2.4: Exception exceptions.UnicodeEncodeError: Famous last words of Python 2.4 (debug build): XXX undetected error
Traceback (most recent call last):
File "test.py", line 4, in ?
print S.split(u'\xc4')
UnicodeEncodeError: 'ascii' codec can't encode
character u'\xe4' in position 0: ordinal not in range(128)
[6545 refs] This bug has been reported first on the zope-dev list. |
Logged In: YES This error not only happens with u'\xc4', it happens with |
Logged In: YES Please attach a test case that shows the failure. I can't |
Logged In: YES I can't reproduce this: >>> ick = u'\xc4'
>>> import struct
>>> struct.pack(ick)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode character
u'\xc4' in position 0: ordinal not in range(128)
>>> struct.pack(u'i', 1)
'\x01\x00\x00\x00' The code that provked this in Zope is buggy., |
Logged In: YES For the record, this appeared to be due to an extension PyString_AsString(name)[0] when name was a Unicode string containing a "high-bit" |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: