You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a specific setup (did not have time to investigate the root cause or come up with a minimal example, in my specific case it happens in the json module that tries to sort keys) I end up with a list of objects (all strings), but of different types that the istext function wrongly reports to be not of text type.
It raises the following exceptions in the compare methods (__lt__, ...) because istext returns False:
exceptions.TypeError: ("unorderable types: str() and <type 'str'>",)
This can be fixed by changing the check in the (deprecated) method istext in utils/__init__.py to
return isinstance(obj, type(u'')) or isinstance(obj, str)
The text was updated successfully, but these errors were encountered:
In a specific setup (did not have time to investigate the root cause or come up with a minimal example, in my specific case it happens in the json module that tries to sort keys) I end up with a list of objects (all strings), but of different types that the istext function wrongly reports to be not of text type.
It raises the following exceptions in the compare methods (
__lt__
, ...) becauseistext
returnsFalse
:exceptions.TypeError: ("unorderable types: str() and <type 'str'>",)
This can be fixed by changing the check in the (deprecated) method
istext
inutils/__init__.py
toreturn isinstance(obj, type(u'')) or isinstance(obj, str)
The text was updated successfully, but these errors were encountered: