RTEMS tools invalid version file

Amar Takhar amar at rtems.org
Tue Oct 30 02:06:35 UTC 2018


On 2018-10-30 11:20 +1100, Chris Johns wrote:
<snip>
> Amar mentioned something about this in a chat the other day and I have not
> chased it up.
<snip>

This is quick since it's late but the issue I ran into is in 

  rtemstoolkit/version.py

In line 174: -- if that's the latest

  _revision = int(''.join(itertools.takewhile(str.isdigit, rev)))

Depending on the version of Python you are running 'rev' can be unicode() or 
str().  The operation being run is not valid for unicode.

The fix I did to solve this issue was to coerce it to str()

_revision = int(''.join(itertools.takewhile(str.isdigit, str(rev))))

This should be harmless since the value is always a string anyway so no data 
will ever be lost.


Amar.


More information about the users mailing list