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 1791095 - Installation with python3-lib389 lib produces msg "BytesWarning: str() on a bytes instance"
Summary: Installation with python3-lib389 lib produces msg "BytesWarning: str() on a b...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: 389-ds-base
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.2
Assignee: mreynolds
QA Contact: RHDS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-14 20:17 UTC by mreynolds
Modified: 2023-02-18 04:29 UTC (History)
5 users (show)

Fixed In Version: 389-ds-1.4-8020020200120164339.bf00efc9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:01:40 UTC
Type: ---
Target Upstream Version:
Embargoed:
mreynolds: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 3852 0 None closed Installation with python3-lib389 lib produces msg "BytesWarning: str() on a bytes instance" 2021-01-11 17:03:17 UTC
Red Hat Issue Tracker RHELPLAN-32335 0 None None None 2023-02-18 04:29:28 UTC
Red Hat Product Errata RHBA-2020:1703 0 None None None 2020-04-28 16:01:49 UTC

Description mreynolds 2020-01-14 20:17:03 UTC
This bug is created as a clone of upstream ticket:
https://pagure.io/389-ds-base/issue/50798

#### Issue Description

When installing FreeIPA server on fedora 31 with the python library, the following message is displayed:
```
...
  [1/44]: creating directory server instance
/usr/lib/python3.7/site-packages/lib389/instance/setup.py:786: BytesWarning: str() on a bytes instance
  self.log.debug(f"CMD: {' '.join(result.args)} ; STDOUT: {result.stdout} ; STDERR: {result.stderr}")
  [2/44]: configure autobind for root
...
```

Uninstallation also produces the same type of message:
```
...
Unconfiguring directory server
/usr/lib/python3.7/site-packages/lib389/instance/remove.py:105: BytesWarning: str() on a bytes instance
  _log.debug(f"CMD: {' '.join(result.args)} ; STDOUT: {result.stdout} ; STDERR: {result.stderr}")
Unconfiguring ipa-custodia

...
```
#### Package Version and Platform
389-ds-base-1.4.2.5-3.fc31.x86_64
freeipa-server-4.9.0.dev201912201432+git-0.fc31.x86_64 (from copr @freeipa/freeipa-master-nightly)

#### Steps to reproduce

1. ipa-server-install --domain $DOMAIN --realm $REALM -a Secret123 -p Secret123 -U
2. ipa-server-install --uninstall -U

### Proposed fix

In the file `lib389/instance/setup.py`, the line 786:
```
            self.log.debug(f"CMD: {' '.join(result.args)} ; STDOUT: {result.stdout} ; STDERR: {result.stderr}")
```
should use `result.stdout.decode('utf-8')` and `result.stderr.decode('utf-8')`

In the file `lib389/instance/remove.py` the line 105:
```
        _log.debug(f"CMD: {' '.join(result.args)} ; STDOUT: {result.stdout.decode()} ; STDERR: {result.stderr.decode()}")
```
should use `result.stdout.decode('utf-8')` and `result.stderr.decode('utf-8')`

Comment 4 errata-xmlrpc 2020-04-28 16:01:40 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, 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/RHBA-2020:1703


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