boostorg / boostorg/python

exec_file fails completely on Python 3.1 and above

Aberta
#371 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
C++
Estrelas
537
Forks
223
Merge médio
11h 22min
PRs com merge (30d)
2

Descrição

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.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Locate the boost::python::exec_file implementation and trace the PY_VERSION_HEX >= 0x03010000 path through PyBytes_AsString and Py_RunFile. Confirm the buffer remains valid when Py_RunFile receives it, then exercise exec_file on Python 3.1 or later and verify that the file executes successfully.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
cpp, python
Domínio
backend
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
48/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.