Skip to content

gh-155742: Get PyBytes_AS_STRING() as const char* - #155751

Open
vstinner wants to merge 2 commits into
python:mainfrom
vstinner:const_char
Open

gh-155742: Get PyBytes_AS_STRING() as const char*#155751
vstinner wants to merge 2 commits into
python:mainfrom
vstinner:const_char

Conversation

@vstinner

@vstinner vstinner commented Aug 13, 2026

Copy link
Copy Markdown
Member

Use "const char*" type instead of "char*" to store PyBytes_AS_STRING(). Treat immutable bytes as immutable.

Use "const char*" type instead of "char*" to store
PyBytes_AS_STRING(). Treat immutable bytes as immutable.
Comment thread Modules/grpmodule.c Outdated
{
char *buf = NULL, *buf2 = NULL, *name_chars;
char *buf = NULL, *buf2 = NULL;
char *name_chars;

@picnixz picnixz Aug 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this change (?) are you smissing a const here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. At some stage of my patch, it was const char *, but then I had to revert to char *. At the end, this change is not needed, I just reverted it (same in the pwd module).

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

Labels

awaiting core review interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants