Project

General

Profile

Actions

Bug #11681

closed

[SDK] Cannot compare newstr() and str()

Added by Peter Amstutz almost 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
Story points:
-

Description

arvados-cwl-runner crashes on Python 2.7 since merging Python 3 compatability:

2017-05-11 13:46:02 arvados.cwl-runner ERROR: Execution failed: unorderable types: str() and <type 'str'>
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/arvados_cwl/__init__.py", line 464, in arv_executor
    runnable.run(**kwargs)
  File "build/bdist.linux-x86_64/egg/arvados_cwl/arvcontainer.py", line 70, in run
    rf.sort(key=lambda k: k.resolved)
  File "/home/peter/work/scripts/venv/lib/python2.7/site-packages/future/types/newstr.py", line 306, in __lt__
    raise TypeError(self.unorderable_err.format(type(other)))
TypeError: unorderable types: str() and <type 'str'>

I added logging to print out the types that were being compared (the string contents are all keep references):

[<type 'str'>,
 <class 'future.types.newstr.newstr'>,
 <type 'str'>,
 <type 'str'>,
 <type 'unicode'>,
 <type 'str'>,
 <type 'str'>]

So the problem is that str is comparable to unicode, unicode is comparable to newstr, but newstr is not comparable to str.

Tentatively it looks like KeepLocator.__str__ might be where the newstr is coming from, but I haven't established that definitively.

It seems that KeepLocator.__str__ or something similar previously used to return str and is now returning newstr.

Actions

Also available in: Atom PDF