From 5b8d1e69fa6035a32e3167f48b328b29a1568991 Mon Sep 17 00:00:00 2001 From: David Glick Date: Tue, 24 Feb 2015 15:33:16 -0800 Subject: only reset terminal echo flag if stdin is a tty --- pyramid/scripts/pserve.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py index d68075e01..57e4ab012 100644 --- a/pyramid/scripts/pserve.py +++ b/pyramid/scripts/pserve.py @@ -716,11 +716,12 @@ def _turn_sigterm_into_systemexit(): # pragma: no cover def ensure_echo_on(): # pragma: no cover if termios: - fd = sys.stdin.fileno() - attr_list = termios.tcgetattr(fd) - if not attr_list[3] & termios.ECHO: - attr_list[3] |= termios.ECHO - termios.tcsetattr(fd, termios.TCSANOW, attr_list) + fd = sys.stdin + if fd.isatty(): + attr_list = termios.tcgetattr(fd) + if not attr_list[3] & termios.ECHO: + attr_list[3] |= termios.ECHO + termios.tcsetattr(fd, termios.TCSANOW, attr_list) def install_reloader(poll_interval=1, extra_files=None): # pragma: no cover """ -- cgit v1.2.3 From 1bcc347b21e6ce317b1fb31610b570b7b9930419 Mon Sep 17 00:00:00 2001 From: David Glick Date: Tue, 24 Feb 2015 15:35:05 -0800 Subject: update changelog --- CHANGES.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3084bcfe6..9b10c0831 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -121,7 +121,8 @@ Bug Fixes - Work around an issue where ``pserve --reload`` would leave terminal echo disabled if it reloaded during a pdb session. - See https://github.com/Pylons/pyramid/pull/1577 + See https://github.com/Pylons/pyramid/pull/1577, + https://github.com/Pylons/pyramid/pull/1592 - ``pyramid.wsgi.wsgiapp`` and ``pyramid.wsgi.wsgiapp2`` now raise ``ValueError`` when accidentally passed ``None``. -- cgit v1.2.3