This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Derby #10: Convert 50 sites to Argument Clinic across 4 files
Type: enhancement Stage: resolved
Components: Argument Clinic, Extension Modules Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ZackerySpytz, alex, christian.heimes, dstufft, giampaolo.rodola, janssen, larry, loewis, pitrou, python-dev, serhiy.storchaka, taleinat
Priority: normal Keywords: needs review, patch

Created on 2014-01-08 00:15 by larry, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
bytes_and_bytearray.patch taleinat, 2014-01-21 20:30 review
bytes_and_bytearray_2.patch taleinat, 2014-01-21 22:17 review
ssl_clinic.patch serhiy.storchaka, 2015-04-06 11:46 review
ssl_clinic_2.patch serhiy.storchaka, 2015-04-16 16:36 review
irc.transcript.of._ssl.clinic.discussion.txt larry, 2015-05-03 21:09
Pull Requests
URL Status Linked Edit
PR 14275 merged ZackerySpytz, 2019-06-20 19:25
Messages (27)
msg207635 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-01-08 00:15
This issue is part of the Great Argument Clinic Conversion Derby,
where we're trying to convert as much of Python 3.4 to use
Argument Clinic as we can before Release Candidate 1 on January 19.

This issue asks you to change the following bundle of files:
    Modules/overlapped.c: 21 sites
    Modules/_ssl.c: 20 sites
    Objects/bytes_methods.c: 1 sites
    Objects/bytesobject.c: 8 sites

Talk to me (larry) if you only want to attack part of a bundle.

For instructions on how to convert a function to work with Argument
Clinic, read the "howto":
    http://docs.python.org/dev/howto/clinic.html
msg208590 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-01-20 23:19
While converting Objects/stringlib/transmogrify.h as part of issue20180 (Derby #11), some changes to Objects/bytesobject.c and Objects/bytearrayobject.c were required. Those changes are included in the relevant patch attached to that issue.
msg208698 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-01-21 20:30
Attached patch for AC conversion of Objects/bytesobject.c and Objects/bytearrayobject.c.

This is one patch because there are changes that must be done in bytes_methods.h and bytes_methods.c that affect both of bytesobject.c and bytearrayobject.c. Those changes are in this patch as well.

All methods were converted except for two groups:

1) the various find methods which use the common argument parsing function 'stringlib_parse_args_finds_byte'
2) 'new' and 'init' methods

Also note that both of these classes use some common function implementations found under 'stringlib'. However, since that code is in separate files, I'll upload the conversion patches to the relevant issue (and write an appropriate comment here).
msg208713 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-01-21 22:17
Attached updated patch for bytes and bytearray.

In the previous patch I missed the 'clear' and 'copy' bytearray methods. This patch is a replacement for the previous one, with the additional conversion of these two methods.
msg224134 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-07-27 14:25
New changeset 4d3d0659b55e by Martin v. Löwis in branch 'default':
Issue #20179: Apply Argument Clinic to bytes and bytearray.
http://hg.python.org/cpython/rev/4d3d0659b55e
msg224135 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2014-07-27 14:26
Tal: Thanks for the patch. I applied it with updates to the current Argument Clinic.

_ssl and _overlapped are still to be done.
msg224760 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-08-04 20:13
All the Derby patches should only go into trunk at this point.
msg240149 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-04-06 11:46
Proposed patch converts the _ssl module to Argument Clinic. Total 39 methods converted.
msg240150 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2015-04-06 11:47
I'm concerned the _ssl changes will make security backports significantly more difficult.
msg240152 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-04-06 12:04
_ssl.enum_certificates() and _ssl.enum_crls() is not converted because their parsing code look incorrect (issue23875).
msg241234 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-04-16 16:36
The patch updated to the tip.
msg242473 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-05-03 13:18
New changeset 1eaaf27b3956 by Serhiy Storchaka in branch 'default':
Issue #20179: Converted the _ssl module to Argument Clinic.
https://hg.python.org/cpython/rev/1eaaf27b3956
msg242475 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2015-05-03 13:33
I'm with Alex. The move to argument clinic is going to make it very hard to port patches to older versions of Python, especially Python 2.7.
msg242477 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-05-03 14:29
Sorry. Should I rollback 1eaaf27b3956?
msg242479 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2015-05-03 14:33
I have no opinion on whether this is a good thing or not. Security backports should be few and far between, so I don't think it's a big problem if they are a bit more difficult.
msg242481 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2015-05-03 14:35
How often are patches backported to 2.7?  While I understand the sentiment, I'd like to understand the scale of the objection being raised.  I suspect it's infrequent, making the objection a minor one.
msg242493 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2015-05-03 16:41
You are right, patches are seldomly backported to Python 2.7. Features are never backported. Well, except for one exception: the ssl module. :)
msg242494 - (view) Author: Donald Stufft (dstufft) * (Python committer) Date: 2015-05-03 16:48
I think it's worthwhile to maintain the ability to easily backport patches from 3.x to 2.7, especially given the security sensitive nature of the ssl module.
msg242523 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2015-05-03 21:06
We discussed it in IRC a bit (and I got a little education).  I can propose three remedies:

A) back out the Clinic conversion in _ssl.c
B) support Clinic in 2.7 just for _ssl.c
C) do a one-time backport of the Clinic generated code for _ssl.c

IMO these are in my reverse order of preference; I'd prefer C, then B, then A.  But I'm not supporting _ssl.c, you guys are.  And I want you maintainers to be happy.  So I'll abide by / help you in implementing whatever you prefer.

FWIW, option C would mean doing an otherwise-inert backport of the current _ssl.c from trunk to 2.7, so that we could also backport (by hand) Modules/clinic/_ssl.c.  Then, if in the future, when you change _ssl.c you still copy that file over and tweak it.  But: if you change the arguments to a function, you'd have to *hand-edit* Modules/clinic/_ssl.c to match.
msg242524 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2015-05-03 21:06
Le 03/05/2015 23:06, Larry Hastings a écrit :
> 
> Larry Hastings added the comment:
> 
> We discussed it in IRC a bit (and I got a little education).

Can we have a transcript somewhere?
msg242525 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2015-05-03 21:09
Attached.  Glad you asked right away, it would have been a lot harder to get later!
msg242526 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2015-05-03 21:10
Thank you!
msg242550 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2015-05-04 11:30
> I can propose three remedies:
> 
> A) back out the Clinic conversion in _ssl.c
> B) support Clinic in 2.7 just for _ssl.c
> C) do a one-time backport of the Clinic generated code for _ssl.c

I'd rather have A or C than B.
By the way, this discussion seems to focus on 2.7, but the same issue happens with 3.4 (although Clinic already exists here, so we can just backport Serhiy's work).
msg242551 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2015-05-04 11:34
Clinic's syntax is diverging from what shipped with 3.4.  So if you copied _ssl.c over, it wouldn't work with the Clinic that shipped with 3.4.

Maybe the best thing is if Clinic in trunk supports "legacy mode", where the code it generates is compatible with previous Python versions.  That's basically B but without doing something crazy like shipping Clinic with 2.7.
msg327366 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-10-08 17:59
Can someone clarify whether Modules/overlapped.c should be converted to use AC?
msg346162 - (view) Author: Zackery Spytz (ZackerySpytz) * (Python triager) Date: 2019-06-20 19:27
PR 14275 converts Modules/overlapped.c. Many methods now use METH_FASTCALL.
msg373474 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-07-10 17:43
New changeset 9650fe0197779b4dfded94be111e39c5810f098f by Zackery Spytz in branch 'master':
bpo-20179: Convert the _overlapped module to the Argument Clinic (GH-14275)
https://github.com/python/cpython/commit/9650fe0197779b4dfded94be111e39c5810f098f
History
Date User Action Args
2022-04-11 14:57:56adminsetgithub: 64378
2020-07-10 18:49:47serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-07-10 17:43:44serhiy.storchakasetmessages: + msg373474
2019-06-20 19:27:15ZackerySpytzsetnosy: + ZackerySpytz
messages: + msg346162
2019-06-20 19:25:06ZackerySpytzsetpull_requests: + pull_request14099
2018-10-08 17:59:54taleinatsetmessages: + msg327366
2015-05-04 11:34:48larrysetmessages: + msg242551
2015-05-04 11:30:31pitrousetmessages: + msg242550
2015-05-03 21:10:55pitrousetmessages: + msg242526
2015-05-03 21:09:12larrysetfiles: + irc.transcript.of._ssl.clinic.discussion.txt

messages: + msg242525
2015-05-03 21:06:49pitrousetmessages: + msg242524
2015-05-03 21:06:11larrysetmessages: + msg242523
2015-05-03 16:48:03dstufftsetmessages: + msg242494
2015-05-03 16:41:42christian.heimessetmessages: + msg242493
2015-05-03 14:35:55larrysetmessages: + msg242481
2015-05-03 14:33:44pitrousetmessages: + msg242479
2015-05-03 14:29:20serhiy.storchakasetmessages: + msg242477
2015-05-03 13:33:35christian.heimessetmessages: + msg242475
2015-05-03 13:18:50python-devsetmessages: + msg242473
2015-04-16 16:36:06serhiy.storchakasetfiles: + ssl_clinic_2.patch

messages: + msg241234
2015-04-06 12:04:59serhiy.storchakasetmessages: + msg240152
2015-04-06 11:47:56alexsetmessages: + msg240150
2015-04-06 11:46:35serhiy.storchakasetfiles: + ssl_clinic.patch

nosy: + pitrou, christian.heimes, serhiy.storchaka, janssen, dstufft, alex, giampaolo.rodola
messages: + msg240149

keywords: + needs review
stage: needs patch -> patch review
2015-02-25 15:27:56serhiy.storchakasetcomponents: + Argument Clinic
2014-08-04 20:13:11larrysetmessages: + msg224760
versions: + Python 3.5, - Python 3.4
2014-07-27 14:26:37loewissetnosy: + loewis
messages: + msg224135
2014-07-27 14:25:22python-devsetnosy: + python-dev
messages: + msg224134
2014-01-21 22:17:12taleinatsetfiles: + bytes_and_bytearray_2.patch

messages: + msg208713
2014-01-21 20:30:44taleinatsetfiles: + bytes_and_bytearray.patch
keywords: + patch
messages: + msg208698
2014-01-20 23:19:32taleinatsetnosy: + taleinat
messages: + msg208590
2014-01-08 01:36:37r.david.murraylinkissue20187 dependencies
2014-01-08 00:15:20larrycreate