TypeError: Expected unicode, got EncodedString when cythonizing rados.pyx from Ceph 12.0.x

236 views
Skip to first unread message

Andy Bailey

unread,
May 8, 2017, 1:50:40 PM5/8/17
to cython-users
Hi All,

 I'm troubleshooting a problem that I'm having building the ceph distributed filesystem package from source; the package includes a handful of cythonized python modules. I am clueless about Cython, and I expect that this is probably an issue that I created when building either the Python or Cython sources, but I'm having trouble interpreting this stack stack trace, which I suspect contains a clue that I don't see.

 Initially I thought the issue might be with the content of the rados.pyx file, so I thought I'd try commenting out virtually the entire contents of the .pyx file and still get the same results. Might someone give me a clue? :) 

I'm using python 2.7.13 + cython 0.25.2

Thanks in advance!!


 Compiling rados.pyx because it changed.
[1/1] Cythonizing rados.pyx
Traceback (most recent call last):
  File "/home/bailey/alsi-ceph-2.0/alsi-ceph/ceph-12.0.2/src/pybind/rados/setup.py", line 194, in <module>
    ], build_dir=os.environ.get("CYTHON_BUILD_DIR", None)
  File "/usr/lib/python2.7/dist-packages/Cython/Build/Dependencies.py", line 934, in cythonize
    cythonize_one(*args)
  File "/usr/lib/python2.7/dist-packages/Cython/Build/Dependencies.py", line 1039, in cythonize_one
    result = compile([pyx_file], options)
  File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 686, in compile
    return compile_multiple(source, options)
  File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 664, in compile_multiple
    result = run_pipeline(source, options, context=context)
  File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 494, in run_pipeline
    err, enddata = Pipeline.run_pipeline(pipeline, source)
  File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Pipeline.py", line 340, in run_pipeline
    data = phase(data)
  File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Pipeline.py", line 33, in parse
    scope = context.find_module(full_module_name, pos = initial_pos, need_pxd = 0)
  File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 221, in find_module
    err, result = self.process_pxd(source_desc, scope, qualified_name)
  File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 135, in process_pxd
    result = Pipeline.run_pipeline(pipeline, source_desc)
  File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Pipeline.py", line 340, in run_pipeline
    data = phase(data)
  File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Pipeline.py", line 45, in parse
    full_module_name=module_name)
  File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 353, in parse
    tree = Parsing.p_module(s, pxd, full_module_name)
  File "Cython/Compiler/Parsing.py", line 3530, in Cython.Compiler.Parsing.p_module (/build/cython-0.25.2/Cython/Compiler/Parsing.c:62572)
  File "Cython/Compiler/Parsing.py", line 3545, in Cython.Compiler.Parsing.p_module (/build/cython-0.25.2/Cython/Compiler/Parsing.c:62280)
  File "Cython/Compiler/Parsing.py", line 2249, in Cython.Compiler.Parsing.p_statement_list (/build/cython-0.25.2/Cython/Compiler/Parsing.c:40531)
  File "Cython/Compiler/Parsing.py", line 2181, in Cython.Compiler.Parsing.p_statement (/build/cython-0.25.2/Cython/Compiler/Parsing.c:39354)
  File "Cython/Compiler/Parsing.py", line 2952, in Cython.Compiler.Parsing.p_cdef_statement (/build/cython-0.25.2/Cython/Compiler/Parsing.c:51447)
  File "Cython/Compiler/Parsing.py", line 2996, in Cython.Compiler.Parsing.p_cdef_extern_block (/build/cython-0.25.2/Cython/Compiler/Parsing.c:52500)
  File "Cython/Compiler/Parsing.py", line 916, in Cython.Compiler.Parsing.p_string_literal (/build/cython-0.25.2/Cython/Compiler/Parsing.c:18574)
TypeError: Expected unicode, got EncodedString


 .andy

Andy Bailey

unread,
May 8, 2017, 2:52:51 PM5/8/17
to cython-users
as is so often the cases, moments after throwing in the towel and begging for help, I discovered that I'd inadvertantly replaced some double quotes with angle brackets to try to work around an include dir ordering issue in the rados.pyx file :)

Thanks and hopefully the next poor devil who makes this mistake will find this post :)

 

Robert Bradshaw

unread,
May 21, 2017, 2:06:48 AM5/21/17
to cython...@googlegroups.com
Thanks for following up. Regardless, we should probably be giving a much better error than this. Do you have a minimal reproducible example? 

On Mon, May 8, 2017 at 11:16 AM, Andy Bailey <goos...@gmail.com> wrote:
as is so often the cases, moments after throwing in the towel and begging for help, I discovered that I'd inadvertantly replaced some double quotes with angle brackets to try to work around an include dir ordering issue in the rados.pyx file :)

Thanks and hopefully the next poor devil who makes this mistake will find this post :)

 

--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages