exec_file fails completely on Python 3.1 and above
- Lingua principale
- C++
- Stelle
- 537
- Fork
- 223
- Merge medio
- 11h 22m
- PR unite (30g)
- 2
Descrizione
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, python
- Ambito
- backend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100