You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New warning: conversion from 'Py_ssize_t' to 'int', possible loss of data in Modules/_testcapimodule.c #101656
Possible solution is to use an explicit (int) converter.
I don't think that we should really worry about an overflow in the test code.
I will send a PR to check if this is a proper fix.
Activity
ambv commentedon Feb 7, 2023
I think the fix is to replace the Py_ssize_t variables in the test function to
ints as this is indeed whatPyEval_EvalCodeExexpects.sobolevn commentedon Feb 7, 2023
@ambv can we do that? Because, for example,
c_defaults_lenuses this code:cpython/Modules/_testcapimodule.c
Lines 3165 to 3170 in f87f6e2
And
PyTuple_SizereturnsPy_ssize_t🤔sobolevn commentedon Feb 7, 2023
Either way, we need to convert
Py_ssize_ttointat some point. I propose to do it later on :)ambv commentedon Feb 7, 2023
OK, that makes sense to me, too. Let's go!
pythongh-101656: Fix "conversion from Py_ssize_t to int" warning in `…
gh-101656: Fix "conversion from Py_ssize_t to int" warning in `_testc…
[3.11] pythongh-101656: Fix "conversion from Py_ssize_t to int" warni…
[3.11] gh-101656: Fix "conversion from Py_ssize_t to int" warning in …