Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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

Summary: Installation with python3-lib389 lib produces msg "BytesWarning: str() on a bytes instance"
Product: Red Hat Enterprise Linux 8 Reporter: mreynolds
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: RHDS QE <ds-qe-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: lkrispen, pasik, spichugi, tbordaz, vashirov
Target Milestone: rcFlags: mreynolds: mirror+
Target Release: 8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-1.4-8020020200120164339.bf00efc9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:01:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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