KeyError when stdin is closed

Bug #1980890 reported by Cyril Roelandt
6
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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.opendev.org/c/openstack/python-glanceclient/+/813802
Committed: https://opendev.org/openstack/python-glanceclient/commit/8df9328a60045edae36dc64cee1f2cf3cd4a09fa
Submitter: "Zuul (22348)"
Branch: master

commit 8df9328a60045edae36dc64cee1f2cf3cd4a09fa
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
    Change-Id: If9a3bf68b8dfd953b346697241166578d18bb563

Changed in python-glanceclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (stable/yoga)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (stable/xena)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/python-glanceclient/+/849058
Committed: https://opendev.org/openstack/python-glanceclient/commit/2ad5f0a6b07c25cc8bc371a92baea3d1c52161ad
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 2ad5f0a6b07c25cc8bc371a92baea3d1c52161ad
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
    Change-Id: If9a3bf68b8dfd953b346697241166578d18bb563
    (cherry picked from commit 8df9328a60045edae36dc64cee1f2cf3cd4a09fa)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/python-glanceclient/+/849059
Committed: https://opendev.org/openstack/python-glanceclient/commit/f0ccd09ad5976cc67eaca244c820a7106aecf4c5
Submitter: "Zuul (22348)"
Branch: stable/xena

commit f0ccd09ad5976cc67eaca244c820a7106aecf4c5
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
    Change-Id: If9a3bf68b8dfd953b346697241166578d18bb563
    (cherry picked from commit 8df9328a60045edae36dc64cee1f2cf3cd4a09fa)
    (cherry picked from commit 2ad5f0a6b07c25cc8bc371a92baea3d1c52161ad)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-glanceclient 4.0.1

This issue was fixed in the openstack/python-glanceclient 4.0.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.