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.
The formatting works correctly, but Cython is not smart enough here to detect that the formatting is guaranteed to return a bytes object in this case because it only works in Py3 (and raises an exception in Py2 due to an unknown format conversion type 'b').
As a work-around, you can use a cast, i.e. return <bytes> (b'...' % {...})
Issue:
PEP 461 style bytes formatting (b'%b' % variable) returns basestring. So the following code results in a cythonize error:
Result:
Cannot convert 'basestring' object to bytes implicitly. This is not portable.
This same basic code in python 3.5.1+ returns a bytes object.
The text was updated successfully, but these errors were encountered: