Skip to content

New warning: conversion from 'Py_ssize_t' to 'int', possible loss of data in Modules/_testcapimodule.c #101656

Description

@sobolevn

Снимок экрана 2023-02-07 в 21 22 57

This happens because:

  • Py_ssize_t c_args_len = 0;
  • But, PyEval_EvalCodeEx expects int:
    PyObject*PyEval_EvalCodeEx(PyObject*_co, PyObject*globals, PyObject*locals,
    PyObject*const*args, intargcount,
    PyObject*const*kws, intkwcount,
    PyObject*const*defs, intdefcount,
    PyObject*kwdefs, PyObject*closure)

Looks like this is a side effect of ae62bdd

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.

CC @ambv as the original PR reviewer.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions