Skip to content

Commit 033dc43

Browse files
gh-155952: Fix <unrepresentable> Argument Clinic defaults in several signatures (#155954)
1 parent 8db5262 commit 033dc43

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
@@ -6411,7 +6411,7 @@ def test_typing_module_has_signatures(self):
64116411
methods_unsupported_signature=methods_unsupported_signature)
64126412

64136413
def test_warnings_module_has_signatures(self):
6414-
unsupported_signature = {'warn', 'warn_explicit'}
6414+
unsupported_signature = {'warn_explicit'}
64156415
self._test_module_has_signatures(warnings, unsupported_signature=unsupported_signature)
64166416

64176417
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
@@ -1877,7 +1877,7 @@ pysqlite_connection_call(PyObject *op, PyObject *args, PyObject *kwargs)
18771877
_sqlite3.Connection.execute as pysqlite_connection_execute
18781878
18791879
sql: unicode
1880-
parameters: object = NULL
1880+
parameters: object(c_default = 'NULL') = ()
18811881
/
18821882
18831883
Executes an SQL statement.
@@ -1886,7 +1886,7 @@ Executes an SQL statement.
18861886
static PyObject *
18871887
pysqlite_connection_execute_impl(pysqlite_Connection *self, PyObject *sql,
18881888
PyObject *parameters)
1889-
/*[clinic end generated code: output=5be05ae01ee17ee4 input=27aa7792681ddba2]*/
1889+
/*[clinic end generated code: output=5be05ae01ee17ee4 input=847390a17de45cc7]*/
18901890
{
18911891
PyObject* result = 0;
18921892

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
@@ -2145,7 +2145,7 @@ typealias.__new__ as typealias_new
21452145
name: object(subclass_of="&PyUnicode_Type")
21462146
value: object
21472147
*
2148-
type_params: object = NULL
2148+
type_params: object(c_default="NULL") = ()
21492149
qualname: object(c_default="NULL") = None
21502150
21512151
Create a TypeAliasType.
@@ -2154,7 +2154,7 @@ Create a TypeAliasType.
21542154
static PyObject *
21552155
typealias_new_impl(PyTypeObject *type, PyObject *name, PyObject *value,
21562156
PyObject *type_params, PyObject *qualname)
2157-
/*[clinic end generated code: output=b7f6d9f1c577cd9c input=cbec290f8c4886ef]*/
2157+
/*[clinic end generated code: output=b7f6d9f1c577cd9c input=6516623275f87b5e]*/
21582158
{
21592159
if (type_params != NULL && !PyTuple_Check(type_params)) {
21602160
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
@@ -1156,7 +1156,7 @@ warn as warnings_warn
11561156
source: object = None
11571157
If supplied, the destroyed object which emitted a ResourceWarning
11581158
*
1159-
skip_file_prefixes: object(type='PyTupleObject *', subclass_of='&PyTuple_Type') = NULL
1159+
skip_file_prefixes: object(type='PyTupleObject *', subclass_of='&PyTuple_Type', c_default='NULL') = ()
11601160
An optional tuple of module filename prefixes indicating frames to skip
11611161
during stacklevel computations for stack frame attribution.
11621162
@@ -1167,7 +1167,7 @@ static PyObject *
11671167
warnings_warn_impl(PyObject *module, PyObject *message, PyObject *category,
11681168
Py_ssize_t stacklevel, PyObject *source,
11691169
PyTupleObject *skip_file_prefixes)
1170-
/*[clinic end generated code: output=a68e0f6906c65f80 input=eb37c6a18bec4ea1]*/
1170+
/*[clinic end generated code: output=a68e0f6906c65f80 input=2b52e8b20f508f51]*/
11711171
{
11721172
category = get_category(message, category);
11731173
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)