Bug 8278 - Our asyncio subprocess module behaves differently from Python's
Summary: Our asyncio subprocess module behaves differently from Python's
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Other (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
Depends on:
Reported: 2023-12-29 14:25 CET by Adam Halim
Modified: 2024-01-02 13:14 CET (History)
0 users

See Also:
Acceptance Criteria:


Description Adam Halim cendio 2023-12-29 14:25:12 CET
Broken out from bug 8232 (see bug 8232 comment #59 for some more context).

Our subprocess module behaves differently from the one in Python's standard library. Currently, we always assume that the caller of subprocess_run() cares about stdin, stderr, and stdout. In the stdlib [1], you have to be explicit if you want to send data to the process' stdin, and if you care about stdout/stderr. It would be nice if we could change our module to behave in the same way as the stdlib.

One side effect of our subprocess_run() is that we get ResourceWarnings if we fail to open the process we want to run. This is due to a bug in asyncio, which was fixed in Python 3.8 [2]. Re-writing our module could make the ResourceWarning disappear from the example in bug 8232, comment #59. In that example, ignoring stdin would avoid the branch where the ResourceWarnings appear.

[1] https://docs.python.org/3/library/subprocess.html#subprocess.run
[2] https://github.com/python/cpython/issues/79902

Note You need to log in before you can comment on or make changes to this bug.