GNOME Bugzilla – Bug 735213
Deprecate pipe arguments to GLib.spawn_async
Last modified: 2018-01-10 20:45:35 UTC
GLib.spawn_async is implemented as a static binding wrapper around g_spawn_async_with_pipes(). The static wrapper accepts boolean arguments for standard_input, standard_output, and standard_error. When these boolean are passed as True, the function returns pipes instead of automatically redirecting them. Since GLib.spawn_async_with_pipes (introspected function) works fine, we should deprecate the passing of the pipe flags to spawn_async() in preference for this function. This will give us the ability to eventually get rid of the static spawn_async() bindings and be left with introspection versions of spawn_async() and spawn_async_with_pipes().
The problem here is that spawn_async_with_pipes changes behavior depending on if NULL is passed for the out args or not. And we always pass valid pointers for out args, making it impossible to get the other behavior. To deprecate that part of spawn_async() we'd have to warn in case any of standard_input/standard_output/standard_error is falsy, which is currently the default. What about trying to get three new flags into glib which disable returning the FDs even if a valid pointer is passed. Then we could replicate the current API. Something like: G_SPAWN_STDERR_NO_PIPE, G_SPAWN_STDIN_NO_PIPE, G_SPAWN_STDOUT_NO_PIPE
Created attachment 363979 [details] [review] g_spawn_async_with_pipes: Add flags for not creating pipes Here is what I had in mind.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/81.