Bug 1601901

Summary: Save report to file fails
Product: [Fedora] Fedora EPEL Reporter: Frank Büttner <bugzilla>
Component: openscap-daemonAssignee: Orphan Owner <extras-orphan>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: jcerny, simi+fedora, wsato
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-07-09 02:29:09 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 Frank Büttner 2018-07-17 12:28:14 UTC
Description of problem:
Display the report to the console will work, but save it to file will result in an python error.


Version-Release number of selected component (if applicable):
openscap-daemon-0.1.10-1.el7.noarch

How reproducible:
Every time

Steps to Reproduce:
1. oscapd-cli result 1 1 report > /tmp/test.html

Actual results:
Python error:
Traceback (most recent call last):
  File "/usr/bin/oscapd-cli", line 846, in <module>
    main()
  File "/usr/bin/oscapd-cli", line 838, in main
    cli_result(dbus_iface, args)
  File "/usr/bin/oscapd-cli", line 466, in cli_result
    print(report)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 223182: ordinal not in range(128)


Expected results:
An html file with the report.


Additional info:
oscapd-cli result 1 1 report
Will print the report to the console without errors.
oscapd-cli result 1 1 report | more
Will also fail with the same error.

Comment 1 Frank Büttner 2018-07-17 12:35:33 UTC
As an hot fix:
change:
import io

if sys.version_info < (3,):
    import gobject
else:
    from gi.repository import GObject as gobject

to:
import io

reload(sys)
sys.setdefaultencoding('utf8')

if sys.version_info < (3,):
    import gobject
else:
    from gi.repository import GObject as gobject

in /usr/bin/oscapd-cli

Comment 2 Fedora Admin user for bugzilla script actions 2020-07-08 14:54:02 UTC
This package has changed maintainer in the Fedora.
Reassigning to the new maintainer of this component.

Comment 3 Fedora Admin user for bugzilla script actions 2020-10-20 14:54:11 UTC
This package has changed maintainer in the Fedora.
Reassigning to the new maintainer of this component.

Comment 4 Fedora Admin user for bugzilla script actions 2022-11-28 12:41:28 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 5 Fedora Admin user for bugzilla script actions 2024-07-02 00:26:14 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 6 Troy Dawson 2024-07-09 02:29:09 UTC
EPEL 7 entered end-of-life (EOL) status on 2024-06-30.\n\nEPEL 7 is no longer maintained, which means that it\nwill not receive any further security or bug fix updates.\n As a result we are closing this bug.