Skip to content

Commit aef8258

Browse files
committed
v2.0.3 - hotfix: PATH prompt could block headless starts
The [Y/n] PATH prompt now requires BOTH stdin and stdout to be TTYs. In 2.0.2, a process with stdout redirected but stdin still attached to a console (services, schedulers, wrappers) would block on input() before the server started. stdout-not-a-TTY now suppresses the prompt; the copy-paste hint is printed instead.
1 parent bbddc99 commit aef8258

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

python_pkg/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build-backend = "setuptools.build_meta"
1616

1717
[project]
1818
name = "bibexpy"
19-
version = "2.0.2"
19+
version = "2.0.3"
2020
description = "Self-hosted bibliometric data preparation tool (Scopus + Web of Science)"
2121
readme = "README.md"
2222
requires-python = ">=3.10"

python_pkg/src/bibexpy/cli.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
_WEB_DIR = _PKG_DIR / "_web"
3535
_SERVER_DIR = _PKG_DIR / "_server"
3636

37-
__version__ = "2.0.2"
37+
__version__ = "2.0.3"
3838
__codename__ = "Helium" # v2 surum kod adi (v1 "Hydrogen"in ardili; H -> He)
3939

4040

@@ -319,7 +319,17 @@ def main(argv: list[str] | None = None) -> int:
319319
if hint_dir:
320320
added = False
321321
prompt_marker = config_dir / ".path_setup_offered"
322-
interactive = bool(getattr(sys.stdin, "isatty", lambda: False)())
322+
# GERÇEKTEN etkileşimli mi? stdin VE stdout'un İKİSİ de TTY olmalı.
323+
# Yalnız stdin'e bakmak yetmez: çıktısı dosyaya yönlendirilmiş ama
324+
# stdin'i konsola bağlı bir süreçte (servis/zamanlayıcı/otomasyon)
325+
# input() cevapsız bekler ve SUNUCU HİÇ BAŞLAMAZDI (2.0.2 hatası).
326+
def _tty(stream) -> bool:
327+
try:
328+
return bool(stream and stream.isatty())
329+
except Exception:
330+
return False
331+
332+
interactive = _tty(sys.stdin) and _tty(sys.stdout)
323333
if args.add_path or (interactive and not prompt_marker.exists()):
324334
consent = bool(args.add_path)
325335
if not consent:

0 commit comments

Comments
 (0)