bounded_subprocess 2.1.0__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bounded_subprocess might be problematic. Click here for more details.
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/PKG-INFO +1 -1
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/pyproject.toml +1 -1
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/src/bounded_subprocess/bounded_subprocess_async.py +1 -1
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/src/bounded_subprocess/util.py +15 -1
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/.github/workflows/test.yml +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/.gitignore +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/LICENSE.txt +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/Makefile +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/README.md +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/cspell.config.yaml +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/src/bounded_subprocess/__init__.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/src/bounded_subprocess/bounded_subprocess.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/src/bounded_subprocess/interactive.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/src/bounded_subprocess/interactive_async.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/__init__.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/block_on_inputs.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/close_outputs.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/dies_shortly_after_launch.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/dies_while_writing.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/does_not_read.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/echo_stdin.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/fork_bomb.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/fork_once.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/long_stdout.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/sleep_forever.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/unbounded_output.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/write_forever_but_no_newline.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/module_test.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/test_async.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/test_interactive.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/test_interactive_async.py +0 -0
- {bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bounded_subprocess
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: A library to facilitate running subprocesses that may misbehave.
|
|
5
5
|
Project-URL: Homepage, https://github.com/arjunguha/bounded_subprocess
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/arjunguha/bounded_subprocess
|
|
@@ -9,7 +9,7 @@ import asyncio
|
|
|
9
9
|
|
|
10
10
|
MAX_BYTES_PER_READ = 1024
|
|
11
11
|
SLEEP_BETWEEN_READS = 0.1
|
|
12
|
-
_STDIN_WRITE_TIMEOUT =
|
|
12
|
+
_STDIN_WRITE_TIMEOUT = 3
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class Result:
|
|
@@ -147,6 +147,20 @@ class BoundedSubprocessState:
|
|
|
147
147
|
except BrokenPipeError:
|
|
148
148
|
pass
|
|
149
149
|
|
|
150
|
+
async def close_stdin_async(self, timeout: int) -> None:
|
|
151
|
+
if self.p.stdin is None:
|
|
152
|
+
return
|
|
153
|
+
for _ in range(timeout):
|
|
154
|
+
try:
|
|
155
|
+
self.p.stdin.close()
|
|
156
|
+
return
|
|
157
|
+
except BlockingIOError:
|
|
158
|
+
await asyncio.sleep(1)
|
|
159
|
+
except BrokenPipeError:
|
|
160
|
+
return
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
150
164
|
def try_read(self) -> bool:
|
|
151
165
|
"""
|
|
152
166
|
Reads from the process. Returning False indicates that we should stop
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/src/bounded_subprocess/bounded_subprocess.py
RENAMED
|
File without changes
|
|
File without changes
|
{bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/src/bounded_subprocess/interactive_async.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/dies_while_writing.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bounded_subprocess-2.1.0 → bounded_subprocess-2.2.0}/test/evil_programs/unbounded_output.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|