cocoonstack-sandbox 0.1.2__tar.gz → 0.1.3__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.
- {cocoonstack_sandbox-0.1.2/cocoonstack_sandbox.egg-info → cocoonstack_sandbox-0.1.3}/PKG-INFO +1 -1
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/frames.py +4 -6
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/sandbox.py +2 -3
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3/cocoonstack_sandbox.egg-info}/PKG-INFO +1 -1
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/pyproject.toml +1 -1
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/LICENSE +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/README.md +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/__init__.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/checkpoint.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/client.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/conn.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/errors.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonsandbox/template.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonstack_sandbox.egg-info/SOURCES.txt +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonstack_sandbox.egg-info/dependency_links.txt +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonstack_sandbox.egg-info/top_level.txt +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/setup.cfg +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_client.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_fault_matrix.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_fixtures.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_frames.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_hardening.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_proc.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_proxy.py +0 -0
- {cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/tests/test_wire_binding.py +0 -0
|
@@ -32,12 +32,10 @@ def encode_request(op: str, **fields) -> bytes:
|
|
|
32
32
|
def decode_response(line: bytes) -> dict:
|
|
33
33
|
"""Parses one response frame; the returned dict carries its tag under
|
|
34
34
|
"type" and any binary payload decoded under "data"."""
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
-
#
|
|
39
|
-
# trailing bytes, non-alphabet bytes in the segment) gets the full parse
|
|
40
|
-
# instead of a silently wrong slice.
|
|
35
|
+
# base64 is JSON-escape-free, so a frame shaped exactly {"type":...,
|
|
36
|
+
# "data":...} can be sliced directly, skipping json.loads; any other
|
|
37
|
+
# shape (extra fields, trailing bytes, non-alphabet bytes) falls through
|
|
38
|
+
# to the full parse instead of risking a silently wrong slice.
|
|
41
39
|
if line.startswith(b'{"type":"'):
|
|
42
40
|
te = line.find(b'"', 9)
|
|
43
41
|
if te > 0 and line[9:te] in (b"stdout", b"stderr", b"data") and line.startswith(b'","data":"', te):
|
|
@@ -67,12 +67,11 @@ class Sandbox:
|
|
|
67
67
|
return code
|
|
68
68
|
|
|
69
69
|
def spawn(self, *argv: str, cwd: str = "", env: dict | None = None,
|
|
70
|
-
user: str = ""
|
|
70
|
+
user: str = "") -> int:
|
|
71
71
|
"""Starts argv detached, returning its pid immediately; the process
|
|
72
72
|
keeps a bounded output ring readable later via logs()/attach()."""
|
|
73
73
|
started = self._call("exec", "started", argv=list(argv), cwd=cwd or None,
|
|
74
|
-
env=env, user=user or None,
|
|
75
|
-
detach=True)
|
|
74
|
+
env=env, user=user or None, detach=True)
|
|
76
75
|
return started["pid"]
|
|
77
76
|
|
|
78
77
|
def ps(self) -> list[dict]:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonstack_sandbox.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{cocoonstack_sandbox-0.1.2 → cocoonstack_sandbox-0.1.3}/cocoonstack_sandbox.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|