I am using some composition to build multiple modules. The docstring is module-dependent and this seems to cause an error. My code has the following pattern (greatly reduced):
Compiler crash traceback from this point on:
File "Cython/Compiler/Visitor.py", line 183, in Cython.Compiler.Visitor.TreeVisitor._visit (/home/ilan/minonda/conda-bld/work/Cython-0.23.4/Cython/Compiler/Visitor.c:4646)
File "/data/unixhome/ksheppard/anaconda/envs/py35/lib/python3.5/site-packages/Cython/Compiler/AnalysedTreeTransforms.py", line 74, in visit_FuncDefNode
if not self.all_docstrings and '>>>' not in node.doc:
TypeError: a bytes-like object is required, not 'str'
Traceback (most recent call last):
File "setup.py", line 196, in <module>
ext_modules = cythonize(extensions)
File "/data/unixhome/ksheppard/anaconda/envs/py35/lib/python3.5/site-packages/Cython/Build/Dependencies.py", line 877, in cythonize
cythonize_one(*args)
File "/data/unixhome/ksheppard/anaconda/envs/py35/lib/python3.5/site-packages/Cython/Build/Dependencies.py", line 997, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: ./randomstate/dsfmt.pyx
and the problem is that node.doc is Bytes (technically String.EncodedString) but '>>>' is not. This appears to be caused by Cython reading the .pxi file as binary (I think, 'rb').