[issue38829] Make the function flush_io accessible in the C-API

Jean-Didier report at bugs.python.org
Sun Nov 17 06:52:05 EST 2019


New submission from Jean-Didier <jeandidier.garaud at gmail.com>:

Hello, 
when using an embedded python interpreter in a C++ program, which itself uses MPI, the embedded script's error messages are not flushed properly. 
(see the whole discussion in this StackOverflow : https://stackoverflow.com/questions/29352485/python-print-not-working-when-embedded-into-mpi-program/49076389#49076389).

The current preferred solution involves adding a few calls to flush_io in the C++. 
However, flush_io is a `static` function in `pythonrun.c`, and is not visible in the C-API.

Would it be possible to remove its static attribute, and add a reference to it in pythonrun.h?
Or maybe there is another method to flush IO from the C-API?

----------
components: IO
messages: 356801
nosy: Jean-Didier
priority: normal
severity: normal
status: open
title: Make the function flush_io accessible in the C-API
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38829>
_______________________________________


More information about the Python-bugs-list mailing list