[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-03-08 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for fixing my bug ;-) (bpo-40943)

--

___
Python tracker 

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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-27 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-27 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset c71d24f55828e7f0f2c8750d2e1b04d04539beff by Inada Naoki in branch 
'master':
bpo-43321: Fix SystemError in getargs.c (GH-24656)
https://github.com/python/cpython/commit/c71d24f55828e7f0f2c8750d2e1b04d04539beff


--

___
Python tracker 

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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-25 Thread Inada Naoki


Change by Inada Naoki :


--
keywords: +patch
pull_requests: +23441
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24656

___
Python tracker 

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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-25 Thread Inada Naoki


Inada Naoki  added the comment:

I checked the warning, and now I think Python traceback is fine.

PyArg_Parse*() is used on top of the C function. So python traceback is enough 
to find which function is using '#' without Py_SSIZE_T_CLEAN.

--

___
Python tracker 

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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-25 Thread Inada Naoki


Inada Naoki  added the comment:

Thank you for reporting.

@vstinner Can we provide a nice C traceback too?

--
nosy: +vstinner

___
Python tracker 

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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-25 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +methane

___
Python tracker 

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



[issue43321] PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing data (when PY_SSIZE_T_CLEAN not #define'd)

2021-02-25 Thread Robert


New submission from Robert :

When PY_SSIZE_T_CLEAN  is not #defined in Py3.10, PyArg_ParseTuple() etc. sets 
a SystemError but the return value says 1 (=SUCCESS)! 
=>  Causes terrific crashes with unfilled variables - instead of a clean Python 
exception.

Background: pywin32 suffers in masses from the drop of int support for the 
s#/y#/et#... formats in PyArg_ParseTuple() etc.  (PY_SSIZE_T_CLEAN is required 
in Py3.10). And only part of the source is already PY_SSIZE_T_CLEAN. Now it is 
very difficult to even run tests and weed out / check, because of freezes 
instead of nice Python exceptions.

=> Instead of preventing such freezes, the PY_SSIZE_T_CLEAN mechanism became 
the opposite: a clever trap, a sword of Damocles :)


The cause is in getargs.c:

=== getargs.c / convertsimple() 

#define REQUIRE_PY_SSIZE_T_CLEAN \
if (!(flags & FLAG_SIZE_T)) { \
PyErr_SetString(PyExc_SystemError, \
"PY_SSIZE_T_CLEAN macro must be defined for '#' 
formats"); \
return NULL; \
}
#define RETURN_ERR_OCCURRED return msgbuf

===


=> The return NULL is further processed as no msg NULL -> no error.  
=> Perhaps it should be a `return converterr(...)` or `return 
sstc_system_error(...)` !?

--
components: Interpreter Core
messages: 387678
nosy: kxrob
priority: normal
severity: normal
status: open
title: PyArg_ParseTuple() false-returns SUCCESS though SystemError and missing 
data (when PY_SSIZE_T_CLEAN  not #define'd)
type: crash
versions: Python 3.10

___
Python tracker 

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