New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const arg for PyInt_FromString #46174
Comments
In PyInt_FromString(), please change the type of the first If the function does modify the string, it should be I'm getting a compiler error in some C++ code when I |
So how about submitting a patch *and* building everything from scratch |
Oh, all right. Just don't tell my boss -- he thinks I'm doing I haven't thoroughly studied the test harness, but it looked like <prefix>/bin/python <prefix>/lib/python2.5/test/autotest.py was what I should do? The output generated before/after the patch |
The test suite is run via test/regrtest.py. If you aren't on windows, For myself, I tend to just run "./python -m test.regrtest" in the |
Ok. Ran 'make test' before and after patch. Output identical. |
The patch no longer applies cleanly to the trunk. |
Any opinions as to whether the patch should be reworked for 3.2 or not? |
I'm rejecting this due to the effect it has on the output parameters. The patch ends up have to stick (char *) casts in several places because a pointer into the string provided via the char * input parameter is returned by each affected API to the calling function via a char **output parameter. We can't change the signature of the output parameters since that would break existing code. That then means we also can't change the signature of the input parameters, since we can't guarantee that the recipient of the output parameter won't later use it to change things. The calling code knows whether or not it is going to modify the pointer it receives back, and hence whether or not it is safe to cast away the const-ness of the passed in pointer. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: