[New-bugs-announce] [issue5049] ctypes unwilling to allow pickling wide character array

Jason R. Coombs report at bugs.python.org
Sun Jan 25 03:52:28 CET 2009


New submission from Jason R. Coombs <jaraco at jaraco.com>:

Using Python 2.6.1, I'm unable to pickle a simple object with an array
of wide characters.

import ctypes, pickle

class MyStruct(ctypes.Structure):
  _fields_ = [('name', ctypes.c_wchar*2)]

s = MyStruct('DC')

pickle.dumps(s) # raises ValueError.

Replace ctypes.c_wchar with ctypes.c_char and the pickling works fine.

----------
assignee: theller
components: ctypes
messages: 80493
nosy: jaraco, theller
severity: normal
status: open
title: ctypes unwilling to allow pickling wide character array
type: behavior
versions: Python 2.6, Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5049>
_______________________________________


More information about the New-bugs-announce mailing list