Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-23047

"leapp preupgrade" fails with "UnicodeEncodeError: 'charmap' codec can't encode character u'\u2013' in position 1: character maps to <undefined>"

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • None
    • Low
    • rhel-upgrades
    • 1
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      When LANG=en_US.iso885915 is set in the environment and a weird filename exists in root file system, this leads to a failure with following backtrace:

      Traceback (most recent call last):
        File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
          self.run()
        File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
          self._target(*self._args, **self._kwargs)
        File "/usr/lib/python2.7/site-packages/leapp/repository/actor_definition.py", line 74, in _do_run
          actor_instance.run(*args, **kwargs)
        File "/usr/lib/python2.7/site-packages/leapp/actors/__init__.py", line 289, in run
          self.process(*args)
        File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/rootscanner/actor.py", line 19, in process
          self.produce(scan_dir(b'/'))
        File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/rootscanner/libraries/rootscanner.py", line 33, in scan_dir
          subdirs.append(_create_a_subdir(RootSubdirectory, subdir, os.path.join('/', subdir)))
        File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/rootscanner/libraries/rootscanner.py", line 16, in _create_a_subdir
          if os.path.islink(path):
        File "/usr/lib64/python2.7/posixpath.py", line 142, in islink
          st = os.lstat(path)
        File "/usr/lib64/python2.7/encodings/iso8859_15.py", line 12, in encode
          return codecs.charmap_encode(input,errors,encoding_table)
      UnicodeEncodeError: 'charmap' codec can't encode character u'\u2013' in position 1: character maps to <undefined>
      

      Please provide the package NVR for which bug is seen:

      leapp-upgrade-el7toel8-0.19.0-1.el7_9.noarch

      How reproducible:

      Always

      Steps to reproduce

      1. Create a weird file on root file system
        # touch /$(printf '\342\200\223a')
      2. Set the LANG in the environment and execute the preupgrade
        # export LANG=en_US.iso885915
        # leapp preupgrade

      Expected results

      No error

      Actual results

      Backtrace

              leapp-notifications leapp-notifications
              rhn-support-rmetrich Renaud Métrich
              leapp-notifications leapp-notifications
              RHEL Upgrades QE Team RHEL Upgrades QE Team
              Miriam Portman Miriam Portman
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: