Wrap git invocations in `with`.

Review Request #14400 — Created April 14, 2025 and updated — Latest diff uploaded

Information

Review Board
master

Reviewers

Running with the latest Python, I was getting warnings about leaked file
descriptors, which were coming from git invocations inside the
GitClient, as it created BufferedReader instances for stdout/stderr.
This change wraps those subprocess invocations in with blocks, causing
things to get cleaned up appropriately.

Loaded some diffs and no longer saw warnings about leaked resources.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Wrap git invocations in `with`.
Running with the latest Python, I was getting warnings about leaked file descriptors, which were coming from `git` invocations inside the `GitClient`, as it created `BufferedReader` instances for stdout/stderr. This change wraps those subprocess invocations in `with` blocks, causing things to get cleaned up appropriately. Testing Done: Loaded some diffs and no longer saw warnings about leaked resources.
689b186907c59be8661fd538f166b17a50826553 David Trowbridge
reviewboard/scmtools/git.py
Loading...