KeyError when stdin is closed
Bug #1980890 reported by
Cyril Roelandt
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Glance Client | Status tracked in Victoria | |||||
Victoria |
Fix Released
|
Undecided
|
Unassigned | |||
Wallaby |
New
|
Undecided
|
Unassigned | |||
Xena |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
When stdin is closed, we get a KeyError in get_data_file:
...
if not sys.stdin.isatty():
...
sys.stdin does not have an "isatty" attribute if stdin is closed:
$ python3 -c "import sys; sys.stdin.isatty()" <&-
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'isatty'
Changed in python-glanceclient: | |
status: | New → In Progress |
To post a comment you must log in.
Reviewed: https:/ /review. opendev. org/c/openstack /python- glanceclient/ +/813802 /opendev. org/openstack/ python- glanceclient/ commit/ 8df9328a60045ed ae36dc64cee1f2c f3cd4a09fa
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 8df9328a60045ed ae36dc64cee1f2c f3cd4a09fa
Author: Benedikt Loeffler <email address hidden>
Date: Wed Oct 13 13:50:36 2021 +0200
Check if stdin has isatty attribute
When the stdin is closed, it has no isatty atrribute which leads to a KeyError.
Closes-Bug: #1980890 53b346697241166 578d18bb563
Change-Id: If9a3bf68b8dfd9