Open ddribin opened 1 year ago
Oddly using -
as the input works:
> curl -s http://httpbin.org/ip | jinja2 helloip.tmpl
Your IP address is .
> curl -s http://httpbin.org/ip | jinja2 helloip.tmpl -
Your IP address is xx.xx.xx.127.
(Edited to remove my real IP address.)
yeah, looks like is_fd_alive(sys.stdin)
returns False
because select()
returns a empty lists [], [], []
. I guess sys.stdin.isatty()
should work here, but I'm not too sure.
Piping to
stdin
sometimes does not work. Let's take thehttpbin.org
example:Yet, the
curl
command does output JSON:In fact saving this to a file and then using
cat
to pipe it tojinja2
does work:Not sure why piping
cat
would be any different than pipingcurl
.I'm on macOS Ventura 13.3.1 (Intel) running Python installed from Homebrew and
jinja2-cli
installed into avenv
.(Edited to remove my real IP address.)