android: pythonthreefication kicks to

These changes made the stack tool work for me without hanging
and crashing in Python3.

I did not inspect the surrounding code and did not test with other tools
from bin/, YMMV.

Also I was confused with these things done by the tool:

1. Copying its input to the output before processing it. :butwhymeme:
   - removed this printing

2. Ignoring EOF
   - change it to stop processing input when encountering EOF (i.e.
     pressing Ctrl+D ends the session quietly)

3. Waiting for a line "not looking like backtrace" to start symbolizing
   - clarified this in the welcome message

      # Now paste a crash from logcat.

Bug: None
Test: out/AndroidRelease/bin/trichrome_chrome_google_bundle stack \
Change-Id: I36431ae7c46252aae9e21122ce931f7111b41d22
Reviewed-by: Dirk Pranke <>
Reviewed-by: Andrew Grieve <>
Commit-Queue: Egor Pasko <>
Cr-Commit-Position: refs/heads/main@{#926227}
GitOrigin-RevId: 86775be5a579b53a01d09d47d82b666aea9b251a
diff --git a/development/scripts/ b/development/scripts/
index de79a05..ccf1f47 100755
--- a/development/scripts/
+++ b/development/scripts/
@@ -203,7 +203,8 @@
     rootdir, symbol.SYMBOLS_DIR = UnzipSymbols(zip_arg)
   if not arguments or arguments[0] == "-":
-'Reading native crash info from stdin')
+'Reading native crash info from stdin (symbolization starts '
+                 'on the first unrelated line or EOF)')
     with llvm_symbolizer.LLVMSymbolizer() as symbolizer:
       stack_core.StreamingConvertTrace(sys.stdin, {}, more_info,
                                        fallback_monochrome, arch_defined,
diff --git a/development/scripts/ b/development/scripts/
index 4b7e67b..a61e95a 100755
--- a/development/scripts/
+++ b/development/scripts/
@@ -186,7 +186,8 @@
   preprocessor = PreProcessLog(load_vaddrs, apks_directory)
   for line in iter(sys.stdin.readline, b''):
-    print(line)
+    if not line: # EOF
+      break
     maybe_line, maybe_so_dir = preprocessor([line])