#4059 closed defect (fixed)

RSB: UnicodeDecodeError

Reported by: Sebastian Huber Owned by:
Priority: normal Milestone: 5.2
Component: tool/rsb Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

The RSB some times cannot create a report due to an Unicode decode error:

error: building powerpc-rtems5-gdb-9.1-x86_64-linux-gnu-1
Build FAILED
error: failure to create error report
Build Set: Time 0:01:29.712543
Traceback (most recent call last):
  File "../source-builder/sb/cmd-set-builder.py", line 26, in <module>
    setbuilder.run()
  File "/scratch/git-rtems-release/5.1-rc2/rtems-source-builder-5.1-rc2/source-builder/sb/setbuilder.py", line 736, in run
    b.build(deps, mail = mail)
  File "/scratch/git-rtems-release/5.1-rc2/rtems-source-builder-5.1-rc2/source-builder/sb/setbuilder.py", line 473, in build
    self.build_package(configs[s], b)
  File "/scratch/git-rtems-release/5.1-rc2/rtems-source-builder-5.1-rc2/source-builder/sb/setbuilder.py", line 258, in build_package
    _build.make()
  File "/scratch/git-rtems-release/5.1-rc2/rtems-source-builder-5.1-rc2/source-builder/sb/build.py", line 603, in make
    self._generate_report_('Build: %s' % (gerr))
  File "/scratch/git-rtems-release/5.1-rc2/rtems-source-builder-5.1-rc2/source-builder/sb/build.py", line 126, in _generate_report_
    self.opts, header, footer)
  File "/scratch/git-rtems-release/5.1-rc2/rtems-source-builder-5.1-rc2/source-builder/sb/ereport.py", line 56, in generate
    l.write(os.linesep.join(r))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 50: ordinal not in range(128)
RSB Error Report: 

Change History (3)

comment:1 Changed on 09/17/21 at 06:25:25 by Hilgad Montelo

This error also happens when the RSB tool is trying to build RTEMS for others architectures and packages (found on release 5.1):
building: rtems-tools-29ad0ec7a8ec8aae5afeb32ef8be03707f626843-1
error: building rtems-tools-29ad0ec7a8ec8aae5afeb32ef8be03707f626843-1
Build FAILED
error: failure to create error report
Build Set: Time 3:07:57.408978
Traceback (most recent call last):

File "../source-builder/sb/cmd-set-builder.py", line 26, in <module>

setbuilder.run()

File "$Dev/RTEMS/rtems-bbb/tools/rtems-source-builder/source-builder/sb/setbuilder.py", line 736, in run

b.build(deps, mail = mail)

File "$Dev/RTEMS/rtems-bbb/tools/rtems-source-builder/source-builder/sb/setbuilder.py", line 473, in build

self.build_package(configs[s], b)

File "$Dev/RTEMS/rtems-bbb/tools/rtems-source-builder/source-builder/sb/setbuilder.py", line 258, in build_package

_build.make()

File "$Dev/RTEMS/rtems-bbb/tools/rtems-source-builder/source-builder/sb/build.py", line 603, in make

self._generate_report_('Build: %s' % (gerr))

File "$Dev/RTEMS/rtems-bbb/tools/rtems-source-builder/source-builder/sb/build.py", line 126, in _generate_report_

self.opts, header, footer)

File "$Dev/RTEMS/rtems-bbb/tools/rtems-source-builder/source-builder/sb/ereport.py", line 56, in generate

l.write(os.linesep.join(r))

UnicodeDecodeError?: 'ascii' codec can't decode byte 0xe2 in position 70: ordinal not in range(128)

Last edited on 09/17/21 at 06:32:21 by Hilgad Montelo (previous) (diff)

comment:2 Changed on 12/22/21 at 11:37:04 by Arne Ehrlich

This error occurs when the python locale environment is not set correctly.
I got this for an compile error message when rtems-source-builder failing to building expat on MacOS.

ensuring LANG and LC_ALL are set fixed the problem writing the error log

export LANG='en_US.UTF-8' LC_ALL='en_US.UTF-8'

LANG is generally set correctly on macos.

if one is setting one of the LC_* variables to a different locale
(I use LC_TIME="de_DE.UTF-8")

then python assumes the encoding is ascii only.

setting LC_ALL overrides this and python happily uses utf-8 again.

Note: See TracTickets for help on using tickets.