classification
Title: Segfault when stringifying UnicodeEncodeError (or UnicodeDecodeError) created with __new__()
Type: crash Stage: resolved
Components: Unicode Versions: Python 3.5, Python 3.4, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Marek.Kowalski, benjamin.peterson, ezio.melotti, haypo, python-dev
Priority: normal Keywords:

Created on 2014-04-02 14:10 by Marek.Kowalski, last changed 2014-04-02 17:39 by benjamin.peterson.

Files
File name Uploaded Description Edit
segv.py Marek.Kowalski, 2014-04-02 14:10 Minial script causing segfault
Messages (5)
msg215384 - (view) Author: Marek Kowalski (Marek.Kowalski) Date: 2014-04-02 14:10
I'm attaching a minimal script to reproduce. I tested only with 3.2 and 2.7 versions. Its possible that it has been fixed since 3.2.
msg215386 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2014-04-02 14:44
Python 3.2 is not getting bugfixes anymore, only 3.4 and 3.5 (and 2.7).
msg215389 - (view) Author: Roundup Robot (python-dev) Date: 2014-04-02 16:17
New changeset 140c5da3dc82 by Benjamin Peterson in branch '3.4':
bail in unicode error's __str__ methods if the objects are not properly initialized (closes #21134)
http://hg.python.org/cpython/rev/140c5da3dc82

New changeset afa7fb2cbe3b by Benjamin Peterson in branch '2.7':
bail in unicode error's __str__ methods if the objects are not properly initialized (closes #21134)
http://hg.python.org/cpython/rev/afa7fb2cbe3b

New changeset 0aeaea247d7d by Benjamin Peterson in branch 'default':
merge 3.4 (#21134)
http://hg.python.org/cpython/rev/0aeaea247d7d
msg215390 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2014-04-02 17:11
Benjamin: I don't like your change. You silently ignore the error. I would prefer to raise an exception on str(exc) if the Unicode exception object was not properly initialized.
msg215391 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2014-04-02 17:39
I don't care as long as it doesn't segfault.
History
Date User Action Args
2014-04-02 17:39:26benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg215391
2014-04-02 17:11:36hayposetstatus: closed -> open
resolution: fixed ->
messages: + msg215390
2014-04-02 16:17:07python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg215389

resolution: fixed
stage: resolved
2014-04-02 14:44:38hayposetmessages: + msg215386
versions: + Python 3.4, Python 3.5, - Python 3.2
2014-04-02 14:10:37Marek.Kowalskicreate