cool-printer-74432
07/01/2022, 5:15 PMpants repl
? E.g., help(str)
in repl
gives me empty output.cool-printer-74432
07/01/2022, 5:17 PMPAGER
because pydoc.render_doc(str)
does generate the right text.enough-analyst-54434
07/01/2022, 5:22 PM./pants repl src/python/pants/util/strutil.py
in the Pants repo on main and help(str)
in the session got me help output. My PAGER
is unset though.cool-printer-74432
07/01/2022, 5:23 PMcool-printer-74432
07/01/2022, 5:24 PMPAGER= ./pants repl
cool-printer-74432
07/01/2022, 5:33 PMpydoc.pager("Hello, world!")
directly, this definitely seems to be the problem part. Empty output in pants repl
but works in a vanilla python3.9 interpreter.enough-analyst-54434
07/01/2022, 5:35 PMhelp(str)
and `pydoc.pager("Hello, world!")`work for me. The changes between 2.11.1rc2 and 2.11.1 do not indicate a fix; so it looks like I don't repro.enough-analyst-54434
07/01/2022, 5:35 PMenough-analyst-54434
07/01/2022, 5:37 PMsys.executable
in the repl session the same as the one you've tried manually?cool-printer-74432
07/01/2022, 5:39 PMenough-analyst-54434
07/01/2022, 5:39 PMenough-analyst-54434
07/01/2022, 5:43 PM./pants repl
picks an interpreter with a -handwave- issue vs. your manual repl tests use a different interpreter.cool-printer-74432
07/01/2022, 5:44 PMsys.executable
is the same binary in both cases (/usr/bin/python3.9
). Also, looks like PAGER=cat
works. Which makes it sound like this may be terminal issues--everyone's favorite part of Linux. But I can probably track down the issue with a bit more investigation...enough-analyst-54434
07/01/2022, 5:45 PMcool-printer-74432
07/01/2022, 6:18 PMless
and more
. And definitely unrelated to pydoc, I can repro with any content long enough to trigger pagination, E.g., /proc/cpuinfo
. subprocess.run(["less", "/proc/cpuinfo"])
gives me no output. subprocess.run(["more", "/proc/cpuinfo"])
gives me the first page and then behaves as if it's receiving no input.cool-printer-74432
07/01/2022, 6:21 PMsubprocess.run(["strace", "-o", "/tmp/lessout.strace", "less", "/proc/cpuinfo"])
is informative. less
gets ENXIO
trying to open /dev/tty
and everything goes downhill from there.enough-analyst-54434
07/01/2022, 6:22 PM./pants run
and ./pants repl
, but standard processes Pants runs have hermetic envs where we only let a limited set of env variables leak in from your environment.cool-printer-74432
07/01/2022, 6:24 PMos.environ
looks like I've got all my normal environment. Doesn't appear to be sanitized.enough-analyst-54434
07/01/2022, 6:24 PM--no-pantsd
?cool-printer-74432
07/01/2022, 6:25 PMless
works normally with --no-pantsd
cool-printer-74432
07/01/2022, 6:27 PMenv -i PATH="$PATH" HOME="$HOME" TERM="$TERM" ./pants repl
enough-analyst-54434
07/01/2022, 6:28 PM./pants repl ...
run - which will start up a fresh pantsd.cool-printer-74432
07/01/2022, 6:32 PMenough-analyst-54434
07/01/2022, 6:32 PMcool-printer-74432
07/01/2022, 7:24 PM