[pypy-issue] [issue1230] Pypy ctypes struct initialization and assignment bug

Mariano Guerra tracker at bugs.pypy.org
Tue Aug 7 07:01:51 CEST 2012

New submission from Mariano Guerra <luismarianoguerra at gmail.com>:


I'm having problems running my project SassPython under pypy, the problem seems
to be in the ctypes implementation, the two problems I identified is that fields
in a ctypes Structure are initialized differently in python and pypy and
assignment fails on pypy, here is a guide to reproduce the problem:


attached is the same guide with the code needed to see the problem.

just for completeness here is the traceback when trying to assign to a field in
a subclass of ctypes.Structure that was initialized from a c function call.

Traceback (most recent call last):
  File "app_main.py", line 51, in run_toplevel
  File "sass.py", line 57, in <module>
    ctx.source_string = ""
  File "/home/mariano/src/soft/pypy-1.9/lib_pypy/_ctypes/structure.py",
 line 108, in __set__
    store_reference(obj, key, cobj._objects)
  File "/home/mariano/src/soft/pypy-1.9/lib_pypy/_ctypes/basics.py", li
ne 21, in store_reference
    while '_index' in where.__dict__:
AttributeError: 'NoneType' object has no attribute '__dict__'

files: pypy.rst
messages: 4638
nosy: marianoguerra, pypy-issue
priority: bug
status: unread
title: Pypy ctypes struct initialization and assignment bug

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list