RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1840142 - python-dateutil from openstack-16-tools-for-rhel-8-x86_64-rpms repo triggers UnicodeWarning
Summary: python-dateutil from openstack-16-tools-for-rhel-8-x86_64-rpms repo triggers ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rpm
Version: 8.2
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: 8.0
Assignee: Michal Domonkos
QA Contact: Jan Blazek
URL:
Whiteboard:
: 1894349 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-26 13:06 UTC by David Juran
Modified: 2024-10-01 16:37 UTC (History)
8 users (show)

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.
Clone Of:
Environment:
Last Closed: 2021-11-09 20:01:59 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:4489 0 None None None 2021-11-09 20:02:13 UTC

Description David Juran 2020-05-26 13:06:25 UTC
Description of problem:
After enabling the openstack-16-tools-for-rhel-8-x86_64-rpms repo, python-datutil started triggering an ugly warning

Version-Release number of selected component (if applicable):
python3-dateutil-2.8.0-1.el8ost.noarch

How reproducible:


Steps to Reproduce:
1. sudo dnf provides /usr/bin/openstack
Updating Subscription Management repositories.
/usr/lib/python3.6/site-packages/dateutil/parser/_parser.py:70: UnicodeWarning: decode() called on unicode string, see https://bugzilla.redhat.com/show_bug.cgi?id=1693751
  instream = instream.decode()

Last metadata expiration check: 0:01:04 ago on Tue 26 May 2020 15:56:02 EEST.
python3-openstackclient-4.0.0-0.20191025160014.aa64eb6.el8ost.noarch : OpenStack Command-line Client
Repo        : openstack-16-tools-for-rhel-8-x86_64-rpms
Matched from:
Filename    : /usr/bin/openstack

Comment 7 Lumír Balhar 2020-06-22 14:05:01 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.

Comment 8 Lumír Balhar 2020-06-22 15:29:46 UTC
Upstream dateutil PR: https://github.com/dateutil/dateutil/pull/1060

Comment 9 Petr Viktorin (pviktori) 2020-07-01 12:14:50 UTC
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?

Comment 18 Radek Bíba 2020-11-18 13:02:31 UTC
*** Bug 1894349 has been marked as a duplicate of this bug. ***

Comment 35 errata-xmlrpc 2021-11-09 20:01:59 UTC
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


Note You need to log in before you can comment on or make changes to this bug.