The HTTP access log (log_message) and the --log-requests REQUEST/RESPONSE lines wrote to the rebindable sys.stderr, so a concurrent card-free request (the 2s /api/status poll) dropped its log line into the StringIO a card command was capturing - corrupting file content read during a snapshot scan (the access-log line appeared inside the file hex). - Add _log_stderr(): write the request/access log to fd 2 directly (the same bypass the APDU tracer already uses), so it can never enter a capture. Route log_message, _log_req and _log_resp through it. - Add _capture_app_output() context manager and deduplicate the six handlers (cardinfo/command/help/read/write/tree) that did the inline app.stdout/sys.stderr = out save/restore dance. Bumps VERSION to 3.40.5 and the SW cache to simple-v491.
25 lines
812 B
TOML
25 lines
812 B
TOML
[build-system]
|
|
requires = ["setuptools", "wheel"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "pysim-simple-server"
|
|
version = "3.40.5"
|
|
description = "HTTP REST server wrapping pysim for the SIMple PWA"
|
|
license = { text = "GPL-2.0-or-later" }
|
|
requires-python = ">=3.9"
|
|
# pysim is a git-only dependency installed explicitly by setup.bat/setup.sh.
|
|
# Declaring it here would make pip resolve its full tree (including the SMPP
|
|
# bridge -> Twisted -> twisted-iocpsupport, which needs MSVC on Windows).
|
|
|
|
[project.scripts]
|
|
pysim-simple-server = "pysim_simple_server.__main__:main"
|
|
|
|
[tool.setuptools]
|
|
license-files = ["LICENSE", "THIRD-PARTY-NOTICES"]
|
|
|
|
[tool.setuptools.packages.find]
|
|
include = ["pysim_simple_server*"]
|
|
|
|
[tool.setuptools.package-data]
|
|
pysim_simple_server = ["data/*.json", "data/*.LICENSE"] |