Skip to content

Commit 31e1476

Browse files
[3.14] gh-155952: Fix <unrepresentable> Argument Clinic defaults in several signatures (#156172)
(cherry picked from commit 5a7fd42) Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 8288442 commit 31e1476

10 files changed

Lines changed: 20 additions & 17 deletions

File tree

Lib/test/test_inspect/test_inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6283,7 +6283,7 @@ def test_typing_module_has_signatures(self):
62836283
methods_unsupported_signature=methods_unsupported_signature)
62846284

62856285
def test_warnings_module_has_signatures(self):
6286-
unsupported_signature = {'warn', 'warn_explicit'}
6286+
unsupported_signature = {'warn_explicit'}
62876287
self._test_module_has_signatures(warnings, unsupported_signature=unsupported_signature)
62886288

62896289
def test_weakref_module_has_signatures(self):
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix the signatures of :meth:`sqlite3.Connection.execute`, :func:`warnings.warn`
2+
and :func:`locale.setlocale` which rendered ``<unrepresentable>`` instead of the
3+
correct defaults for parameters.

Modules/_localemodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ check_locale_name_all(const char *locale)
126126
_locale.setlocale
127127
128128
category: int
129-
locale: str(accept={str, NoneType}) = NULL
129+
locale: str(accept={str, NoneType}) = None
130130
/
131131
132132
Activates/queries locale processing.
133133
[clinic start generated code]*/
134134

135135
static PyObject *
136136
_locale_setlocale_impl(PyObject *module, int category, const char *locale)
137-
/*[clinic end generated code: output=a0e777ae5d2ff117 input=dbe18f1d66c57a6a]*/
137+
/*[clinic end generated code: output=a0e777ae5d2ff117 input=b53449b63407179b]*/
138138
{
139139
char *result;
140140
PyObject *result_object;

Modules/_sqlite/clinic/connection.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_sqlite/connection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ pysqlite_connection_call(PyObject *op, PyObject *args, PyObject *kwargs)
19291929
_sqlite3.Connection.execute as pysqlite_connection_execute
19301930
19311931
sql: unicode
1932-
parameters: object = NULL
1932+
parameters: object(c_default = 'NULL') = ()
19331933
/
19341934
19351935
Executes an SQL statement.
@@ -1938,7 +1938,7 @@ Executes an SQL statement.
19381938
static PyObject *
19391939
pysqlite_connection_execute_impl(pysqlite_Connection *self, PyObject *sql,
19401940
PyObject *parameters)
1941-
/*[clinic end generated code: output=5be05ae01ee17ee4 input=27aa7792681ddba2]*/
1941+
/*[clinic end generated code: output=5be05ae01ee17ee4 input=847390a17de45cc7]*/
19421942
{
19431943
PyObject* result = 0;
19441944

Modules/clinic/_localemodule.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Objects/clinic/typevarobject.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Objects/typevarobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,15 +2084,15 @@ typealias.__new__ as typealias_new
20842084
name: object(subclass_of="&PyUnicode_Type")
20852085
value: object
20862086
*
2087-
type_params: object = NULL
2087+
type_params: object(c_default="NULL") = ()
20882088
20892089
Create a TypeAliasType.
20902090
[clinic start generated code]*/
20912091

20922092
static PyObject *
20932093
typealias_new_impl(PyTypeObject *type, PyObject *name, PyObject *value,
20942094
PyObject *type_params)
2095-
/*[clinic end generated code: output=8920ce6bdff86f00 input=df163c34e17e1a35]*/
2095+
/*[clinic end generated code: output=8920ce6bdff86f00 input=8838986b41cae743]*/
20962096
{
20972097
if (type_params != NULL && !PyTuple_Check(type_params)) {
20982098
PyErr_SetString(PyExc_TypeError, "type_params must be a tuple");

Python/_warnings.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ warn as warnings_warn
11921192
source: object = None
11931193
If supplied, the destroyed object which emitted a ResourceWarning
11941194
*
1195-
skip_file_prefixes: object(type='PyTupleObject *', subclass_of='&PyTuple_Type') = NULL
1195+
skip_file_prefixes: object(type='PyTupleObject *', subclass_of='&PyTuple_Type', c_default='NULL') = ()
11961196
An optional tuple of module filename prefixes indicating frames to skip
11971197
during stacklevel computations for stack frame attribution.
11981198
@@ -1203,7 +1203,7 @@ static PyObject *
12031203
warnings_warn_impl(PyObject *module, PyObject *message, PyObject *category,
12041204
Py_ssize_t stacklevel, PyObject *source,
12051205
PyTupleObject *skip_file_prefixes)
1206-
/*[clinic end generated code: output=a68e0f6906c65f80 input=eb37c6a18bec4ea1]*/
1206+
/*[clinic end generated code: output=a68e0f6906c65f80 input=2b52e8b20f508f51]*/
12071207
{
12081208
category = get_category(message, category);
12091209
if (category == NULL)

Python/clinic/_warnings.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)