Bug#996084: vte2.91: wrong argument list in spawn_async documentation
Simon McVittie
smcv at debian.org
Sun Oct 10 23:25:42 BST 2021
On Sun, 10 Oct 2021 at 23:07:35 +0200, Nis Martensen wrote:
> According to
> https://lazka.github.io/pgi-docs/Vte-2.91/classes/Terminal.html#Vte.Terminal.spawn_async
> and
> https://lazka.github.io/pgi-docs/#Vte-2.91/classes/Pty.html#Vte.Pty.spawn_async
> the order of arguments includes:
> ..., spawn_flags, child_setup, timeout, ...
>
> However, the code does not work when trying to use that argument order,
> the result is: TypeError: Argument 9 does not allow None as a value
>
> It would be great if the code and its documentation would match.
Debian does not maintain that documentation, and the representation of
C functions in PyGI is really a question for PyGI rather than the specific
C library whose API has been wrapped.
The signature of these functions in C is:
void vte_terminal_spawn_async(VteTerminal *terminal,
VtePtyFlags pty_flags,
const char *working_directory,
char **argv,
char **envv,
GSpawnFlags spawn_flags,
GSpawnChildSetupFunc child_setup,
gpointer child_setup_data,
GDestroyNotify child_setup_data_destroy,
int timeout,
GCancellable *cancellable,
VteTerminalSpawnAsyncCallback callback,
gpointer user_data) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(4);
void vte_pty_spawn_async(VtePty *pty,
const char *working_directory,
char **argv,
char **envv,
GSpawnFlags spawn_flags,
GSpawnChildSetupFunc child_setup,
gpointer child_setup_data,
GDestroyNotify child_setup_data_destroy,
int timeout,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(3);
and you can find the GObject-Introspection representation of them in
/usr/share/gir-1.0/Vte-2.91.gir.
It looks as though whatever software generated
https://lazka.github.io/pgi-docs/Vte-2.91 is assuming that the
(child_setup, child_setup_data, child_setup_data_destroy) group
will come out in PyGI as a single argument, child_setup.
However, from the stackoverflow question, it looks like child_setup
and child_setup_data turn into separate arguments in Python, with
only child_setup_data_destroy disappearing.
This seems like a bug in the documentation-generating tool.
smcv
More information about the pkg-gnome-maintainers
mailing list