[ python-Bugs-1082085 ] PyString_AsString() segfaults when passed a
unicode string
SourceForge.net
noreply at sourceforge.net
Thu Dec 9 14:12:08 CET 2004
Bugs item #1082085, was opened at 2004-12-09 08:08
Message generated for change (Comment added) made by ajung
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1082085&group_id=5470
Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 7
Submitted By: Andreas Jung (ajung)
Assigned to: Nobody/Anonymous (nobody)
Summary: PyString_AsString() segfaults when passed a unicode string
Initial Comment:
If you pass a PyObject representation the unicode
string u'\xc4'
to PyString_AsString() then Python (2.3.4, 2.4.0) segfault.
Famous last words of Python 2.4:
Exception exceptions.UnicodeEncodeError:
<exceptions.UnicodeEncodeError instance at 0xf6f75e8c>
in 'garbage collection' ignored
Fatal Python error: unexpected exception during garbage
collection
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.
I confirmed
that this error does not only occur in Zope but also in
a Python-only
environment.
----------------------------------------------------------------------
>Comment By: Andreas Jung (ajung)
Date: 2004-12-09 08:12
Message:
Logged In: YES
user_id=11084
This error not only happens with u'\xc4', it happens with
*any* string
containing a character >0x7f.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1082085&group_id=5470
More information about the Python-bugs-list
mailing list