Skip to content

Commit 4516910

Browse files
[3.13] gh-155952: Fix <unrepresentable> Argument Clinic defaults in several signatures (#156170)
(cherry picked from commit 5a7fd42) Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 4f3afba commit 4516910

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
@@ -6377,7 +6377,7 @@ def test_typing_module_has_signatures(self):
63776377
methods_unsupported_signature=methods_unsupported_signature)
63786378

63796379
def test_warnings_module_has_signatures(self):
6380-
unsupported_signature = {'warn', 'warn_explicit'}
6380+
unsupported_signature = {'warn_explicit'}
63816381
self._test_module_has_signatures(warnings, unsupported_signature=unsupported_signature)
63826382

63836383
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
@@ -1891,7 +1891,7 @@ pysqlite_connection_call(pysqlite_Connection *self, PyObject *args,
18911891
_sqlite3.Connection.execute as pysqlite_connection_execute
18921892
18931893
sql: unicode
1894-
parameters: object = NULL
1894+
parameters: object(c_default = 'NULL') = ()
18951895
/
18961896
18971897
Executes an SQL statement.
@@ -1900,7 +1900,7 @@ Executes an SQL statement.
19001900
static PyObject *
19011901
pysqlite_connection_execute_impl(pysqlite_Connection *self, PyObject *sql,
19021902
PyObject *parameters)
1903-
/*[clinic end generated code: output=5be05ae01ee17ee4 input=27aa7792681ddba2]*/
1903+
/*[clinic end generated code: output=5be05ae01ee17ee4 input=847390a17de45cc7]*/
19041904
{
19051905
PyObject* result = 0;
19061906

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
@@ -1715,15 +1715,15 @@ typealias.__new__ as typealias_new
17151715
name: object(subclass_of="&PyUnicode_Type")
17161716
value: object
17171717
*
1718-
type_params: object = NULL
1718+
type_params: object(c_default="NULL") = ()
17191719
17201720
Create a TypeAliasType.
17211721
[clinic start generated code]*/
17221722

17231723
static PyObject *
17241724
typealias_new_impl(PyTypeObject *type, PyObject *name, PyObject *value,
17251725
PyObject *type_params)
1726-
/*[clinic end generated code: output=8920ce6bdff86f00 input=df163c34e17e1a35]*/
1726+
/*[clinic end generated code: output=8920ce6bdff86f00 input=8838986b41cae743]*/
17271727
{
17281728
if (type_params != NULL && !PyTuple_Check(type_params)) {
17291729
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
@@ -1023,7 +1023,7 @@ warn as warnings_warn
10231023
source: object = None
10241024
If supplied, the destroyed object which emitted a ResourceWarning
10251025
*
1026-
skip_file_prefixes: object(type='PyTupleObject *', subclass_of='&PyTuple_Type') = NULL
1026+
skip_file_prefixes: object(type='PyTupleObject *', subclass_of='&PyTuple_Type', c_default='NULL') = ()
10271027
An optional tuple of module filename prefixes indicating frames to skip
10281028
during stacklevel computations for stack frame attribution.
10291029
@@ -1034,7 +1034,7 @@ static PyObject *
10341034
warnings_warn_impl(PyObject *module, PyObject *message, PyObject *category,
10351035
Py_ssize_t stacklevel, PyObject *source,
10361036
PyTupleObject *skip_file_prefixes)
1037-
/*[clinic end generated code: output=a68e0f6906c65f80 input=eb37c6a18bec4ea1]*/
1037+
/*[clinic end generated code: output=a68e0f6906c65f80 input=2b52e8b20f508f51]*/
10381038
{
10391039
category = get_category(message, category);
10401040
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)