@danhachuel/thunderbolt 0.5.14 → 0.5.16

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.16
4
+
5
+ Adicionado um handler SIGINT no entry point do Streamlit que encerra o processo de forma controlada antes do handler de shutdown do Streamlit chamar `click.secho`, eliminando o caminho que provocava `LookupError: unknown encoding: utf-16-le` ao pressionar Ctrl+C no Windows.
6
+
7
+ ## 0.5.15 (normalizado pelo npm para 0.5.15)
8
+
9
+ Aplicada a correcção definitiva do caminho de saída do Click no Windows, com shim UTF-8 carregado antes do Streamlit e teste de regressão para stdout com encoding `utf-16-le`.
10
+
3
11
  ## 0.5.09 (normalizado pelo npm para 0.5.9)
4
12
 
5
13
  Adicionado um shim de compatibilidade que intercepta a escrita de saída do Click antes do carregamento do Streamlit e grava directamente em UTF-8, evitando o caminho nativo que volta a procurar `utf-16-le` durante o shutdown do Windows. Incluídos testes com um console simulado em `utf-16-le`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.5.14",
3
+ "version": "0.5.16",
4
4
  "description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
5
5
  "license": "MIT",
6
6
  "main": "scripts/cli.mjs",
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import os
4
+ import signal
4
5
  import sys
5
6
  from windows_encoding_compat import install as install_windows_encoding, wrap_stream
6
7
 
@@ -31,5 +32,13 @@ sys.stderr = _utf8_stream(sys.stderr)
31
32
 
32
33
  from streamlit.web.cli import main # noqa: E402
33
34
 
35
+
36
+ def custom_sigint_handler(signum: int, frame: object) -> None:
37
+ """Exit before Streamlit's Click shutdown handler writes to Win32 console."""
38
+ print("\nEncerrando servidor...", file=sys.stderr)
39
+ raise SystemExit(0)
40
+
41
+
34
42
  if __name__ == "__main__":
43
+ signal.signal(signal.SIGINT, custom_sigint_handler)
35
44
  main()