Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Support non-UTF8 locale #354

Open
bocekm opened this issue Feb 16, 2018 · 0 comments
Open

Support non-UTF8 locale #354

bocekm opened this issue Feb 16, 2018 · 0 comments
Labels

Comments

@bocekm
Copy link
Collaborator

bocekm commented Feb 16, 2018

When the machine has a non-utf8 locale set then many RHEL6_7 modules (13 of them) fail with error. All of them fail because they use is_pkg_installed() python API function which opens the VALUE_RPM_QA file with utf8 decoding.

Traceback (most recent call last):
  File "/root/preupgrade/RHEL6_7/system/yum/check", line 25, in <module>
    check_applies_to (check_applies="yum")
  File "/usr/lib/python2.6/site-packages/preupg/script_api.py", line 485, in check_applies_to
    if not (is_pkg_installed(rpm) and is_dist_native(rpm)):
  File "/usr/lib/python2.6/site-packages/preupg/script_api.py", line 465, in is_pkg_installed
    lines = FileHelper.get_file_content(VALUE_RPM_QA, "rb", True)
  File "/usr/lib/python2.6/site-packages/preupg/utils.py", line 188, in get_file_content
    data = f.read() if not method else f.readlines()
  File "/usr/lib64/python2.6/codecs.py", line 679, in readlines
    return self.reader.readlines(sizehint)
  File "/usr/lib64/python2.6/codecs.py", line 588, in readlines
    data = self.read()
  File "/usr/lib64/python2.6/codecs.py", line 477, in read
    newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc4 in position 38: invalid continuation byte
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant