A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-January/130866.html below:

[Python-Dev] cpython: threading.RLock._acquire_restore() now raises a TypeError instead of a

[Python-Dev] cpython: threading.RLock._acquire_restore() now raises a TypeError instead of aVictor Stinner victor.stinner at gmail.com
Fri Jan 3 11:54:39 CET 2014
Hi,

2014/1/3 Serhiy Storchaka <storchaka at gmail.com>:
>> -    if (!PyArg_ParseTuple(arg, "kl:_acquire_restore", &count, &owner))
>> +    if (!PyArg_ParseTuple(args, "(kl):_acquire_restore", &count, &owner))
>>           return NULL;
>
> Please don't use "(...)" in PyArg_ParseTuple, it is dangerous (see issue6083
> [1]).
>
> [1] http://bugs.python.org/issue6083

Oh, I didn't know this issue. Keeping a reference to the tuple is
annoying, it adds a lot of cleanup code.

Would it be possible to handle this issue in Argument Clinic, split
the function in two parts: a function to parse arguments and keep
references, and the implementation function?

I already saw that when a format requires to keep a reference. See for
example os_path() and os_path_impl() in Modules/posixmodule.c.

Victor
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4