Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pythonrun.c: main_module ref leak in_PyRun_SimpleStringFlagsWithName #146355

Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error
@A0su

Description

@A0su

Bug report

Bug description:

Bug report

Bug description:

This is a sub-issue for#146102 and original gist details can be foundhere

Existing code:

int_PyRun_SimpleStringFlagsWithName(constchar*command,constchar*name,PyCompilerFlags*flags) {PyObject*main_module=PyImport_AddModuleRef("__main__");if (main_module==NULL) {return-1;    }PyObject*dict=PyModule_GetDict(main_module);// borrowed refPyObject*res=NULL;if (name==NULL) {res=PyRun_StringFlags(command,Py_file_input,dict,dict,flags);    }else {PyObject*the_name=PyUnicode_FromString(name);if (!the_name) {PyErr_Print();return-1;        }res=_PyRun_StringFlagsWithName(command,the_name,Py_file_input,dict,dict,flags,0);Py_DECREF(the_name);    }Py_DECREF(main_module);if (res==NULL) {PyErr_Print();return-1;    }Py_DECREF(res);return0;}

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp