compilemodule.py not working
Hi I cannot get the compilemodule to work. It seems that strings returned from PyString_FromStringAndSize are unwrapped automatically, causing ctypes.byref to fail. Traceback (most recent call last): File "../bin/compilemodule.py", line 12, in ? main(sys.argv) File "/usr/src/pypy-dist/pypy/rpython/rctypes/tool/compilemodule.py", line 78, in main c_ext_module = compilemodule(argv[1], interactive=True) File "/usr/src/pypy-dist/pypy/rpython/rctypes/tool/compilemodule.py", line 26, in compilemodule module = ModuleClass(space, space.wrap(modname)) File "/usr/src/pypy-dist/pypy/module/thread/__init__.py", line 25, in __init__ MixedModule.__init__(self, space, *args) File "/usr/src/pypy-dist/pypy/interpreter/mixedmodule.py", line 18, in __init__ Module.__init__(self, space, w_name) File "/usr/src/pypy-dist/pypy/interpreter/module.py", line 17, in __init__ space.setitem(w_dict, space.new_interned_str('__name__'), w_name) File "/usr/src/pypy-dist/pypy/objspace/cpy/objspace.py", line 171, in new_interned_str PyString_InternInPlace(byref(w_s)) TypeError: byref() argument must be a ctypes instance, not 'str' -- Haggai Eran
Silly me: I had an older version of ctypes. Version 0.9.9 and 1.0.0 don't have this problem. Haggai On 8/30/06, Haggai Eran <haggai.eran@gmail.com> wrote:
Hi I cannot get the compilemodule to work. It seems that strings returned from PyString_FromStringAndSize are unwrapped automatically, causing ctypes.byref to fail.
Traceback (most recent call last): File "../bin/compilemodule.py", line 12, in ? main(sys.argv) File "/usr/src/pypy-dist/pypy/rpython/rctypes/tool/compilemodule.py", line 78, in main c_ext_module = compilemodule(argv[1], interactive=True) File "/usr/src/pypy-dist/pypy/rpython/rctypes/tool/compilemodule.py", line 26, in compilemodule module = ModuleClass(space, space.wrap(modname)) File "/usr/src/pypy-dist/pypy/module/thread/__init__.py", line 25, in __init__ MixedModule.__init__(self, space, *args) File "/usr/src/pypy-dist/pypy/interpreter/mixedmodule.py", line 18, in __init__ Module.__init__(self, space, w_name) File "/usr/src/pypy-dist/pypy/interpreter/module.py", line 17, in __init__ space.setitem(w_dict, space.new_interned_str('__name__'), w_name) File "/usr/src/pypy-dist/pypy/objspace/cpy/objspace.py", line 171, in new_interned_str PyString_InternInPlace(byref(w_s)) TypeError: byref() argument must be a ctypes instance, not 'str'
-- Haggai Eran
-- Haggai Eran
participants (1)
-
Haggai Eran