Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

c_char array value attribute returns incorrectly #112860

Copy link
Copy link
Open
@evilzhou

Description

@evilzhou
Issue body actions

Bug report

Bug description:

When the array starts with \x00:

from ctypes import create_string_buffer, c_char, addressof

bs = b"\x00\x01\x02\x03\x04"

s = create_string_buffer(bs)
array = (c_char * 16).from_address(addressof(s))
print(array.value)

out:
b''

CPython versions tested on:

3.9

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.