watch can fail (hang) under python3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
etcd3gw |
Fix Released
|
Undecided
|
Tyler Stachecki |
Bug Description
Looking here:
https:/
The iter_content method is requested to do decode of the string as needed, from bytes to unicode. On the very next line, an unconditional decode of the string is done (again).
While this is fine in python2:
Python 2.7.16 (default, Mar 25 2021, 03:11:28)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-
Type "help", "copyright", "credits" or "license" for more information.
>>> b'bytes'
u'bytes'
It causes an AttributeError in python3:
Python 3.8.8 (v3.8.8:024d8058b0, Feb 19 2021, 08:48:17)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> b'bytes'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute 'decode'
This can be hard to see in client code, as etcd3gw.Watcher does not call result() on the future, and so the exception is never materialized.
I am opening this LP so I can reference a fix in the review system.
Changed in python-etcd3gw: | |
assignee: | nobody → Tyler Stachecki (tstachecki) |
Fix proposed to branch: master /review. opendev. org/c/openstack /etcd3gw/ +/817489
Review: https:/