upstream patch from opendev - double encoding-decoding
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-etcd3gw (Ubuntu) |
Fix Released
|
High
|
Heather Lemon | ||
Bionic |
Fix Released
|
High
|
Heather Lemon | ||
Focal |
Fix Released
|
High
|
Heather Lemon | ||
Impish |
Fix Released
|
High
|
Heather Lemon | ||
Jammy |
Fix Released
|
High
|
Heather Lemon | ||
Kinetic |
Fix Released
|
High
|
Heather Lemon |
Bug Description
[Impact]
We cannot decode payloads sent to etcd in Python3.
Which means key, value pairs can not longer be accessed.
Both iter_content and the first line of the loop in the
etcd3gw watch code were decoding the chunk received.
Thus, etcd3gw's watch is broken in python3. This commit
fixes it by only decoding the line once.
[Test Plan]
Run unittests, ensure success
In python2, this works fine:
```
$ python2 -c "print(
hello_world
```
In python3, it raises an AttributeError:
```
$ python3 -c "print(
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'str' object has no attribute 'decode'
```
[Regression potential]
unit test failure,
Which means key, value pairs can not longer be accessed.
In bionic patch, applying the patch fails the unit tests in Python27.
This is fixed by fixing the imports to:
+-from unittest import mock
++from mock import patch, MagicMock
[Other Info]
Link to upstream patch: https:/
python-
Changed in python-etcd3gw (Ubuntu Focal): | |
importance: | Undecided → High |
Changed in python-etcd3gw (Ubuntu Bionic): | |
importance: | Undecided → High |
description: | updated |
description: | updated |
description: | updated |
tags: |
added: sts-sponsor-halves removed: sts-sponsor |
tags: | added: verification-needed-kinetic |
focal debdiff upload march 21, 2022.