Simplified converting to char * by radarhere · Pull Request #8662 · python-pillow/Pillow

Skip to content

Navigation Menu

Sign in

Appearance settings

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

Sign up

Appearance settings

Conversation

@radarhere

Copy link Copy Markdown

Member

@radarhere radarhere commented

Jan 5, 2025

edited

Loading

Rather than using PyUnicode_AsUTF8String to get a PyObject and then passing that to PyBytes_AS_STRING to get char * and PyBytes_GET_SIZE to get Py_ssize_t,

just use PyUnicode_AsUTF8AndSize. It returns const char * and passes back Py_ssize_t.

@hugovk hugovk merged commit b69f204 into python-pillow:main

Jan 8, 2025

@radarhere radarhere deleted the pyunicode branch

January 8, 2025 21:24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@radarhere @hugovk