1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00
github.com_openSUSE_osc/osc/util
Marcus Huewe d85030b72d Fix python2 regression in util.helper.decode_it
In commit 276d6e2439 ("Do not use the
chardet module in util.helper.decode_it") util.helper.decode_it was
changed to always decode the passed object if it has a decode method.
Since a python2 str has a decode method, the new code tries to utf-8
decode the passed str. As a result, a unicode object is returned (if
the decoding worked). Since a unicode object is not an instance of
type str, all subsequent isinstance(decoded_obj, str) checks evaluate
to False, which break some codepaths.
In order to fix this, restore the old python2 behavior (that is, if
the passed object is a str, it is not decode it). This change does not
affect the python3 codepaths.

Fixes: #814 ("osc log | fails")
2020-06-25 15:38:14 +02:00
..
__init__.py - don't fail if terminal encoding doesn't support unicode (fixes #660445) 2011-02-11 02:45:13 +01:00
ar.py Use with statement in ArFile.saveTo 2019-01-15 17:18:50 +01:00
archquery.py Remove superfluous try-except block in the archquery module 2019-01-27 16:51:58 +01:00
cpio.py Use with statement in CpioRead._copyin_file 2019-01-15 20:49:26 +01:00
debquery.py fix and unify building of local package cache 2019-07-26 13:38:45 +02:00
helper.py Fix python2 regression in util.helper.decode_it 2020-06-25 15:38:14 +02:00
packagequery.py Return bytes in packagequery.PackageQueryResult.evr() instead of a str 2020-03-15 18:30:00 +01:00
repodata.py Fix ElementTree imports for Python 3.9 2020-06-02 15:13:10 -07:00
rpmquery.py fix and unify building of local package cache 2019-07-26 13:38:45 +02:00
safewriter.py Fix and simplify util.safewriter.SafeWriter 2018-03-09 16:55:56 +01:00