This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients amaury.forgeotdarc, belopolsky, meador.inge, serhiy.storchaka
Date 2018-12-03.10:52:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1543834348.49.0.788709270274.issue35384@psf.upfronthosting.co.za>
In-reply-to
Content
The repr of the ctypes.CArgObject instance will fail when the value is a non-ascii character.

The code is:

        sprintf(buffer, "<cparam '%c' (%c)>",
            self->tag, self->value.c);
    ...
    return PyUnicode_FromString(buffer);

If self->value.c is out of range 0-127, buffer will contain a string not decodable with UTF-8.

There is a similar problem with non-ascii self->tag.

The following PR is purposed to fix this, but I don't know how to test it. Current tests only create CArgObject instances with tag='P' (in byref()).
History
Date User Action Args
2018-12-03 10:52:28serhiy.storchakasetrecipients: + serhiy.storchaka, amaury.forgeotdarc, belopolsky, meador.inge
2018-12-03 10:52:28serhiy.storchakasetmessageid: <1543834348.49.0.788709270274.issue35384@psf.upfronthosting.co.za>
2018-12-03 10:52:28serhiy.storchakalinkissue35384 messages
2018-12-03 10:52:28serhiy.storchakacreate