[New-bugs-announce] [issue17544] regex code re-raises exceptions on success

Zdeněk Pavlas report at bugs.python.org
Mon Mar 25 16:27:28 CET 2013


New submission from Zdeněk Pavlas:

<documentation>
There is a global indicator (per thread) of the last error that occurred. Most functions do not clear this on success, but will set it to indicate the cause of the error on failure. Most functions also return an error indicator, usually NULL if they are supposed to return a pointer, or -1 if they return an integer.
</documentation>

AIUI, the last error global variable should be ignored, unless function fails.  This is not the case.  To reproduce:

1. call a C function that sets TypeError, but does not return NULL.
2. run a lot of python code, do some I/O.. everything runs fine.
3. run a regexp match, or import the re module.  TypeError is raised.

----------
components: Regular Expressions
messages: 185205
nosy: Zdeněk.Pavlas, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: regex code re-raises exceptions on success
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17544>
_______________________________________


More information about the New-bugs-announce mailing list