[issue16856] Segfault from calling repr() on a dict with a key whose repr raise an exception

2013-01-03 Thread David M. Cooke

New submission from David M. Cooke:

The following segfaults:

class A(int):
def __repr__(self):
raise Exception()
a = A()
d = {a : 1}
repr(d)

This is with Python 3.3.0, running on Mac OS 10.7.5, from MacPorts:
Python 3.3.0 (default, Sep 29 2012, 08:16:08) 
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.58)] on darwin

--
components: Interpreter Core
messages: 178997
nosy: david.m.cooke
priority: normal
severity: normal
status: open
title: Segfault from calling repr() on a dict with a key whose repr raise an 
exception
type: crash
versions: Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16856] Segfault from calling repr() on a dict with a key whose repr raise an exception

2013-01-03 Thread R. David Murray

R. David Murray added the comment:

Confirmed on Gentoo linux.  On default, too.  This is a regression from 3.2.

--
nosy: +r.david.murray
versions: +Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16856] Segfault from calling repr() on a dict with a key whose repr raise an exception

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.

--
assignee:  -> serhiy.storchaka
components: +Unicode
keywords: +3.3regression, patch
nosy: +ezio.melotti, serhiy.storchaka
stage:  -> patch review
Added file: http://bugs.python.org/file28555/unicode_append.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16856] Segfault from calling repr() on a dict with a key whose repr raise an exception

2013-01-04 Thread Christian Heimes

Christian Heimes added the comment:

IMO the check is better performed a couple of lines later:

if (right == NULL || left == NULL || !PyUnicode_Check(left)) {

--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16856] Segfault from calling repr() on a dict with a key whose repr raise an exception

2013-01-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3cee61137598 by Serhiy Storchaka in branch '3.3':
Issue #16856: Fix a segmentation fault from calling repr() on a dict with
http://hg.python.org/cpython/rev/3cee61137598

New changeset fee4bc043d73 by Serhiy Storchaka in branch 'default':
Issue #16856: Fix a segmentation fault from calling repr() on a dict with
http://hg.python.org/cpython/rev/fee4bc043d73

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16856] Segfault from calling repr() on a dict with a key whose repr raise an exception

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> IMO the check is better performed a couple of lines later:

Done.

Thank you for report, David.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com