zrb 1.6.1__py3-none-any.whl → 1.6.3__py3-none-any.whl

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.
zrb/util/cmd/command.py CHANGED
@@ -64,11 +64,28 @@ async def run_command(
64
64
  stream, print_method: Callable[..., None], max_lines: int
65
65
  ) -> str:
66
66
  lines = []
67
+ if hasattr(stream, "_limit"):
68
+ # The limit is set to 10 MB
69
+ stream._limit = 1024 * 1024 * 10
67
70
  while True:
68
- line = await stream.readline()
71
+ line = None
72
+ try:
73
+ line = await stream.readline()
74
+ except asyncio.exceptions.CancelledError:
75
+ pass
76
+ except asyncio.exceptions.LimitOverrunError as e:
77
+ # Recover by reading a limited chunk instead
78
+ await stream.read(e.consumed)
79
+ line = "<output line too long>"
80
+ except BaseException as e:
81
+ line = f"Error while reading stream {type(e)} {e}"
82
+ pass
69
83
  if not line:
70
84
  break
71
- line = line.decode("utf-8").rstrip()
85
+ try:
86
+ line = line.decode("utf-8").rstrip()
87
+ except Exception:
88
+ pass
72
89
  lines.append(line)
73
90
  if len(lines) > max_lines:
74
91
  lines.pop(0) # Keep only the last max_lines
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zrb
3
- Version: 1.6.1
3
+ Version: 1.6.3
4
4
  Summary: Your Automation Powerhouse
5
5
  Home-page: https://github.com/state-alchemists/zrb
6
6
  License: AGPL-3.0-or-later
@@ -343,7 +343,7 @@ zrb/util/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
343
343
  zrb/util/cli/style.py,sha256=D_548KG1gXEirQGdkAVTc81vBdCeInXtnG1gV1yabBA,6655
344
344
  zrb/util/cli/subcommand.py,sha256=umTZIlrL-9g-qc_eRRgdaQgK-whvXK1roFfvnbuY7NQ,1753
345
345
  zrb/util/cmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
346
- zrb/util/cmd/command.py,sha256=9kF3oUfJVsCMZ6KAEwBz6wdE5E4qC3e_AD-u7ZNTj3A,4552
346
+ zrb/util/cmd/command.py,sha256=CsS6KKATOAmM9F482Ox5kVV8hRgFcueqvB5obEcJENs,5211
347
347
  zrb/util/cmd/remote.py,sha256=NGQq2_IrUMDoZz3qmcgtnNYVGjMHaBKQpZxImf0yfXA,1296
348
348
  zrb/util/codemod/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
349
349
  zrb/util/codemod/modification_mode.py,sha256=z_4U2gjskEHkFm6UtBe_Wbm-erufYaXgPbdCQ6CZMlw,128
@@ -369,7 +369,7 @@ zrb/util/string/name.py,sha256=SXEfxJ1-tDOzHqmSV8kvepRVyMqs2XdV_vyoh_9XUu0,1584
369
369
  zrb/util/todo.py,sha256=VGISej2KQZERpornK-8X7bysp4JydMrMUTnG8B0-liI,20708
370
370
  zrb/xcom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
371
371
  zrb/xcom/xcom.py,sha256=o79rxR9wphnShrcIushA0Qt71d_p3ZTxjNf7x9hJB78,1571
372
- zrb-1.6.1.dist-info/METADATA,sha256=Mvuy3HzhIukGZ6QTM3X9RbFhQz6UFXhdngsC53dqSYQ,8385
373
- zrb-1.6.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
374
- zrb-1.6.1.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
375
- zrb-1.6.1.dist-info/RECORD,,
372
+ zrb-1.6.3.dist-info/METADATA,sha256=lq9Tb957J2-bL_K26uJ7xdoD1xnpBksE1rL1Jo9RQc8,8385
373
+ zrb-1.6.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
374
+ zrb-1.6.3.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
375
+ zrb-1.6.3.dist-info/RECORD,,
File without changes