[issue12769] String with NUL characters truncated by ctypes when assigning to a char array

2011-08-17 Thread Rafał Dowgird

New submission from Rafał Dowgird :

The ctypes module seems to truncate NUL-containing strings when assigning to 
structure fields of type c_char*1024. Reproduced on a 2.7.2 compiled from 
tarball. Script to reproduce attached.

--
components: ctypes
files: reproduce.py
messages: 142274
nosy: Rafal.Dowgird
priority: normal
severity: normal
status: open
title: String with NUL characters truncated by ctypes when assigning to a char 
array
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file22920/reproduce.py

___
Python tracker 
<http://bugs.python.org/issue12769>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12769] String with NUL characters truncated by ctypes when assigning to a char array

2011-08-17 Thread Rafał Dowgird

Rafał Dowgird  added the comment:

Attaching output of the script. 'x\000y\000' becomes 'x' after assigning to a 
char array.

--
Added file: http://bugs.python.org/file22921/output.txt

___
Python tracker 
<http://bugs.python.org/issue12769>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12769] String with NUL characters truncated by ctypes when assigning to a char array

2011-08-17 Thread Rafał Dowgird

Rafał Dowgird  added the comment:

The buffer output of the script suggests that the part after the '\000' has not 
been copied into the array at all. If that's the case, then the 'raw' output 
wouldn't print it anyway.

--

___
Python tracker 
<http://bugs.python.org/issue12769>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com