Bug 1601901 - Save report to file fails
Summary: Save report to file fails
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: openscap-daemon
Version: epel7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Orphan Owner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-17 12:28 UTC by Frank Büttner
Modified: 2024-07-09 02:29 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-07-09 02:29:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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