Bug 1840142
Summary: | python-dateutil from openstack-16-tools-for-rhel-8-x86_64-rpms repo triggers UnicodeWarning | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | David Juran <djuran> |
Component: | rpm | Assignee: | Michal Domonkos <mdomonko> |
Status: | CLOSED ERRATA | QA Contact: | Jan Blazek <jblazek> |
Severity: | unspecified | Docs Contact: | |
Priority: | medium | ||
Version: | 8.2 | CC: | gmartins, jalviso, lbalhar, mdomonko, pmatilai, pviktori, torsava, vstinner |
Target Milestone: | rc | Keywords: | Triaged |
Target Release: | 8.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | rpm-4.14.3-16.el8 | Doc Type: | Bug Fix |
Doc Text: |
Cause:
The user updates python3-dateutil to version 2.8. This could happen as part of a regular "dnf update" when subscribed to the OpenStack channels.
Note that this version of python3-dateutil is not available in RHEL 8.5 (which only ships with version 2.6); it's only available in the RHOSP (Red Hat OpenStack Platform) repositories. So basically, while most RHEL customers are unlikely to hit this bug, RHOSP customers may (and do, see the attached customer cases).
Consequence:
After the above update, whenever DNF is used, it may print the following warning: "UnicodeWarning: decode() called on unicode string".
Fix:
The warning, which was harmless, has been removed, as it was no longer deemed necessary.
Result:
DNF no longer prints the warning.
Note:
I intentionally didn't mention that the warning comes in fact from RPM; I consider that an implementation detail. Most users would encounter this issue through the use of DNF. However, if you think we should mention RPM after all (e.g. due to the fact that it's released in an RPM advisory), let me know and I'll rephrase.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2021-11-09 20:01:59 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
David Juran
2020-05-26 13:06:25 UTC
It might be also a good idea to fix dateutil to do the same for both Pythons (use .decode() only for bytes and bytearray) so from: def __init__(self, instream): if six.PY2: # In Python 2, we can't duck type properly because unicode has # a 'decode' function, and we'd be double-decoding if isinstance(instream, (bytes, bytearray)): instream = instream.decode() else: if getattr(instream, 'decode', None) is not None: instream = instream.decode() to def __init__(self, instream): if isinstance(instream, (bytes, bytearray)): instream = instream.decode() I'm gonna try to propose that upstream. Upstream dateutil PR: https://github.com/dateutil/dateutil/pull/1060 Hello, RPM maintainers. The "temporary patch" in https://src.osci.redhat.com/rpms/rpm/blob/rhel-8.3.0/f/0001-Monkey-patch-.decode-method-to-our-strings-as-a-temp.patch is changing behavior of Python's str type, which can break other software. Are there any plans to remove it? *** Bug 1894349 has been marked as a duplicate of this bug. *** Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Low: rpm security, bug fix, and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:4489 |