[PATCH 1/2] Don't rely on terminal attributes being configurable (#1162702)

Samantha N. Bueno sbueno+anaconda at redhat.com
Wed Nov 12 19:32:41 UTC 2014


On Wed, Nov 12, 2014 at 02:24:51PM -0500, David Shea wrote:
> On 11/12/2014 01:54 PM, Samantha N. Bueno wrote:
> >>---
> >>>  pyanaconda/ui/lib/entropy.py | 24 ++++++++++++++++++------
> >>>  1 file changed, 18 insertions(+), 6 deletions(-)
> >>>
> >>>diff --git a/pyanaconda/ui/lib/entropy.py b/pyanaconda/ui/lib/entropy.py
> >>>index 903a796..c8cea29 100644
> >>>--- a/pyanaconda/ui/lib/entropy.py
> >>>+++ b/pyanaconda/ui/lib/entropy.py
> >>>@@ -67,11 +67,21 @@ def _tui_wait(msg, desired_entropy):
> >>>      print(_("After %d minutes, the installation will continue regardless of the "
> >>>              "amount of available entropy") % (MAX_ENTROPY_WAIT / 60))
> >>>      fd = sys.stdin.fileno()
> >>>-    old = termios.tcgetattr(fd)
> >>>-    new = termios.tcgetattr(fd)
> >>>-    new[3] = new[3] & ~termios.ICANON & ~termios.ECHO
> >>>-    new[6][termios.VMIN] = 1
> >>>-    termios.tcsetattr(fd, termios.TCSANOW, new)
> >>>+    termios_attrs_changed = False
> >>>+
> >>>+    try:
> >>>+        old = termios.tcgetattr(fd)
> >>>+        new = termios.tcgetattr(fd)
> >>>+        new[3] = new[3] & ~termios.ICANON & ~termios.ECHO
> >>>+        new[6][termios.VMIN] = 1
> >>>+        termios.tcsetattr(fd, termios.TCSANOW, new)
> >>>+        termios_attrs_changed = True
> >>>+    except SystemError as sys_err:
> >Doesn't look like SystemError is being raised, instead it's just a
> >generic Exception.
> >So I guess an ugly "except Exception as sys_err". This returns a tuple--
> >18:18:05,369 DEBUG anaconda: (25, 'Inappropriate ioctl for device')
> >
> 
> termios raises termios.error on not-s390, which still doesn't inherit from
> anything other than Exception but at least is more specific. Does it use
> this (annoyingly undocumented) class on s390 or did they decide to do that
> different too, because why not?

Ugh, yeah you're right, it is termios.error even on s390x. How stupid.

> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches


More information about the anaconda-patches mailing list