[issue24102] Multiple type confusions in unicode error handlers

2015-05-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 547bc11e3357 by Serhiy Storchaka in branch '2.7': Issue #24102: Fixed exception type checking in standard error handlers. https://hg.python.org/cpython/rev/547bc11e3357 New changeset 68eaa9409818 by Serhiy Storchaka in branch '3.4': Issue #24102:

[issue24102] Multiple type confusions in unicode error handlers

2015-05-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102 ___ ___

[issue24102] Multiple type confusions in unicode error handlers

2015-05-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Greg Ewing suggested to use PyObject_TypeCheck (http://permalink.gmane.org/gmane.comp.python.devel/153216). -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker

[issue24102] Multiple type confusions in unicode error handlers

2015-05-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Also fixed handling errors of PyObject_IsSubclass() (issue24115) in the _codecs module. -- Added file: http://bugs.python.org/file39287/codecs_error_handlers_issubclass_3.patch ___ Python tracker

[issue24102] Multiple type confusions in unicode error handlers

2015-05-03 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102 ___

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Walter Dörwald
Walter Dörwald added the comment: The patch does indeed fix the segmentation fault. However the exception message looks confusing: TypeError: don't know how to handle UnicodeEncodeError in error callback -- ___ Python tracker

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Py_TYPE() is necessary when the argument is not of type PyObject* (e.g. PyUnicodeObject*). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102 ___

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that makes error message consistent with type checking. -- Added file: http://bugs.python.org/file39266/codecs_error_handlers_issubclass_2.patch ___ Python tracker rep...@bugs.python.org

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file39265/codecs_error_handlers_issubclass.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is simpler reproducer: import codecs class X(str): __class__ = UnicodeEncodeError codecs.ignore_errors(X()) The problem is that PyObject_IsInstance() is fooled by custom __class__, but then builtin error handlers handle error object as having

[issue24102] Multiple type confusions in unicode error handlers

2015-05-02 Thread Walter Dörwald
Walter Dörwald added the comment: Looks much better. However shouldn't: exc-ob_type-tp_name be: Py_TYPE(exc)-tp_name (although there are still many spots in the source that still use ob_type-tp_name) -- ___ Python tracker

[issue24102] Multiple type confusions in unicode error handlers

2015-05-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +Interpreter Core, Unicode nosy: +doerwalter, ezio.melotti, haypo, lemburg, serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102

[issue24102] Multiple type confusions in unicode error handlers

2015-05-01 Thread paul
New submission from paul: # Breakpoint 1, PyUnicodeEncodeError_GetEnd (exc=X at remote 0x405730e4, end=0xbf9e8f7c) at Objects/exceptions.c:1643 # 1643PyObject *obj = get_unicode(((PyUnicodeErrorObject *)exc)-object, # (gdb) s # get_unicode (attr=unknown at remote 0x8c6a120,

[issue24102] Multiple type confusions in unicode error handlers

2015-05-01 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- components: +Extension Modules nosy: +christian.heimes stage: - needs patch versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24102