Issue 27740: Fix doc of Py_CompileStringExFlags (original) (raw)

Created on 2016-08-11 18:13 by xiang.zhang, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Py_CompileStringExFlags_doc.patch xiang.zhang,2016-08-12 11:18 review
issue27740.patch xiang.zhang,2016-08-27 19:41 review
Messages (6)
msg272468 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-08-11 18:13
I think the doc of Py_CompileStringExFlags has two flaws: 1. Py_CompileStringExFlags should be replaced by Py_CompileStringObject from the context. Py_CompileStringExFlags in the context is meaningless. 2. *filename* is a byte string that should be decoded but not decoded from. It is ... = decode(filename) but not filename = decode(...).
msg273130 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-08-19 14:53
Ping.
msg273137 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-08-19 15:45
I don't understand the second part of the patch. *filename* is a filesystem encoding (:func:`os.fsdecode`) encoded string [...] Do you want to document that filename should be encoded by using PyUnicode_EncodeFSDefault *before* passing it to Py_CompileStringExFlags (you will probably need to wrap it with something like PyBytes_AsString too)? If so, I think the os.fsdecode() part needs to be changed to os.fsencode(). I think the current wording is saying that filename is going to be decoded inside of Py_CompileStringExFlags (which is also correct.)
msg273139 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-08-19 15:55
> filename is going to be decoded inside of Py_CompileStringExFlags Actually all I want to express is this, *filename* will be decoded inside. But now the wording looks to me is that *filename* is already a decoded string when passed. I don't want to document anything about PyUnicode_EncodeFSDefault. I should remove (:func:`os.fsdecode`). How do you think? I'm Okay if you think the current wording is correct.
msg273798 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-08-27 19:41
I am not a native speaker so I decide not to trap in the minor part. Could you just fix the first point if there is no doubt? I'm okay with the second part staying as now.
msg277645 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-28 16:34
New changeset ee76e84f115f by Berker Peksag in branch '3.5': Issue #27740: Fix typo in Py_CompileStringExFlags https://hg.python.org/cpython/rev/ee76e84f115f New changeset 2ee939b314a2 by Berker Peksag in branch '3.6': Issue #27740: Merge from 3.5 https://hg.python.org/cpython/rev/2ee939b314a2 New changeset a0b13ea75849 by Berker Peksag in branch 'default': Issue #27740: Merge from 3.6 https://hg.python.org/cpython/rev/a0b13ea75849
History
Date User Action Args
2022-04-11 14:58:34 admin set github: 71927
2016-09-28 16:34:55 berker.peksag set status: open -> closedstage: patch review -> resolvedresolution: fixedversions: + Python 3.7
2016-09-28 16:34:34 python-dev set nosy: + python-devmessages: +
2016-08-27 19:41:35 xiang.zhang set files: + issue27740.patchmessages: +
2016-08-19 15:55:38 xiang.zhang set messages: +
2016-08-19 15:45:35 berker.peksag set versions: + Python 3.5nosy: + berker.peksag, vstinnermessages: + stage: patch review
2016-08-19 14:53:30 xiang.zhang set messages: +
2016-08-12 11🔞04 xiang.zhang set files: + Py_CompileStringExFlags_doc.patch
2016-08-12 11:17:50 xiang.zhang set files: - Py_CompileStringExFlags_doc.patch
2016-08-11 18:13:23 xiang.zhang create