boostorg / boostorg/python

exec_file fails completely on Python 3.1 and above

Open
#371 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
537
Forks
223
Avg merge
11h 22m
Merged PRs (30d)
2

Description

When PY_VERSION_HEX >= 0x03010000, boost::python::exec_file passes an invalid string to Py_RunFile.

The problem is that char* f points to a temporary buffer returned by the UTF conversion routine PyBytes_AsString, but this buffer is deallocated via Py_DECREF before f gets passed to Py_RunFile.

I will create a pull request with a fix shortly.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.