Notice: We have migrated to GitLab launching 2024-05-01 see here:

#3312 closed defect (fixed)

RSB macro calls such as define fail on unicode keys.

Reported by: Chris Johns Owned by: Chris Johns
Priority: normal Milestone: 5.1
Component: tool/rsb Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking: #3313


The define call in checks for a str while the __setitem__ call can convert a unicode string to str. Remove the check.

Remove the other places in a key str check is made and see if they can be improved.

The following has been reported to me:

cd rtems-source-builder-4.11.3/rtems
../source-builder/sb-set-builder --prefix=/home/user/rtems/4.11 --log=arm.txt --without-rtems 4.11/rtems-arm
Traceback (most recent call last):
  File "../source-builder/sb-set-builder", line 29, in <module>
  File "../source-builder/sb/", line 526, in run
    opts = options.load(sys.argv, optargs)
  File "../source-builder/sb/", line 668, in load
  File "../source-builder/sb/", line 123, in load_release_settings
    sources.hash((hs[0], hash[0], hs[1]), macros, setting_error)
  File "../source-builder/sb/", line 105, in hash
    macros.define(_file, '%s %s' % (args[0], args[2]))
  File "../source-builder/sb/", line 439, in define
    raise TypeError('bad key type: %s' % (type(key)))
TypeError: bad key type: <type 'unicode'>

Change History (2)

comment:1 Changed on 02/23/18 at 01:27:27 by Chris Johns

Blocking: 3313 added

comment:2 Changed on 02/25/18 at 21:33:37 by Chris Johns <chrisj@…>

Resolution: fixed
Status: assignedclosed

In [changeset:"d255e812abd5d46d7cbbd4ef924f9d1267100c0b/rtems-source-builder" d255e81/rtems-source-builder]:

sb: Convert any unicode keys to strings

Closes #3312

Note: See TracTickets for help on using tickets.