Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(105127)

#28769: Make PyUnicode_AsUTF8 returning "const char *" rather of "char *"

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 years, 12 months ago by storchaka+cpython
Modified:
2 years, 11 months ago
Reviewers:
vadmium+py, victor.stinner
CC:
Nick Coghlan, haypo, devnull_psf.upfronthosting.co.za, storchaka
Visibility:
Public.

Patch Set 1 #

Total comments: 11

Patch Set 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/c-api/unicode.rst View 1 2 chunks +9 lines, -3 lines 0 comments Download
Doc/whatsnew/3.7.rst View 1 1 chunk +4 lines, -0 lines 0 comments Download
Include/unicodeobject.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
Modules/_dbmmodule.c View 1 1 chunk +1 line, -1 line 0 comments Download
Modules/_decimal/_decimal.c View 1 3 chunks +6 lines, -5 lines 0 comments Download
Modules/_gdbmmodule.c View 1 1 chunk +1 line, -1 line 0 comments Download
Objects/object.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
Objects/unicodeobject.c View 1 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 6
Martin Panter
https://bugs.python.org/review/28769/diff/19253/Doc/whatsnew/3.7.rst File Doc/whatsnew/3.7.rst (right): https://bugs.python.org/review/28769/diff/19253/Doc/whatsnew/3.7.rst#newcode109 Doc/whatsnew/3.7.rst:109: is now of type of type ``const char *`` ...
2 years, 12 months ago #1
victor.stinner_gmail.com
http://bugs.python.org/review/28769/diff/19253/Modules/_decimal/_decimal.c File Modules/_decimal/_decimal.c (right): http://bugs.python.org/review/28769/diff/19253/Modules/_decimal/_decimal.c#newcode3202 Modules/_decimal/_decimal.c:3202: fmt = (char *)PyUnicode_AsUTF8AndSize(fmtarg, &size); Note for reviewers: Ah, ...
2 years, 12 months ago #2
Martin Panter
http://bugs.python.org/review/28769/diff/19253/Objects/object.c File Objects/object.c (right): http://bugs.python.org/review/28769/diff/19253/Objects/object.c#newcode893 Objects/object.c:893: char *name_str = (char *)PyUnicode_AsUTF8(name); On 2016/11/22 09:54:34, haypo ...
2 years, 12 months ago #3
storchaka
https://bugs.python.org/review/28769/diff/19253/Doc/whatsnew/3.7.rst File Doc/whatsnew/3.7.rst (right): https://bugs.python.org/review/28769/diff/19253/Doc/whatsnew/3.7.rst#newcode109 Doc/whatsnew/3.7.rst:109: is now of type of type ``const char *`` ...
2 years, 12 months ago #4
victor.stinner_gmail.com
http://bugs.python.org/review/28769/diff/19253/Objects/object.c File Objects/object.c (right): http://bugs.python.org/review/28769/diff/19253/Objects/object.c#newcode893 Objects/object.c:893: char *name_str = (char *)PyUnicode_AsUTF8(name); > It is already ...
2 years, 12 months ago #5
Martin Panter
2 years, 12 months ago #6
https://bugs.python.org/review/28769/diff/19253/Objects/object.c
File Objects/object.c (right):

https://bugs.python.org/review/28769/diff/19253/Objects/object.c#newcode893
Objects/object.c:893: char *name_str = (char *)PyUnicode_AsUTF8(name);
On 2016/11/22 10:07:31, haypo wrote:
> > https://docs.python.org/3.7/c-api/typeobj.html#c.PyTypeObject.tp_getattr
> So it's (char*), not (const char*).

That’ll teach me not to blindly trust the documentation, sorry for the
confusion! I opened <https://bugs.python.org/issue28771> to fix this.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+