➜

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
标题: PEP 3121 Refactoring applied to _csv module
类型: enhancement Stage: resolved
Components: Extension Modules Versions: Python 3.3
process
状态: closed Resolution: fixed
Dependencies: 后续:
分配给: 抄送列表: Robin.Schreiber, eric.araujo, loewis, pitrou, python-dev, skip.montanaro
优先级: low 关键字: patch

Created on 2012-05-05 19:47 by Robin.Schreiber, last changed 2022-04-11 14:57 by admin. This issue is now closed.

文件
文件名 上传时间 Description 编辑
csv_pep3121.patch Robin.Schreiber, 2012-05-05 19:47 Patches csv extension module for PEP3121 compliance. review
refactoring_test.py Robin.Schreiber, 2012-05-05 19:49
csv_pep3121_fix1.patch Robin.Schreiber, 2012-05-13 10:11 Adds the missing Py_INCREF statements mentioned by Antoine review
Messages (10)
msg160032 - (view) Author: Robin Schreiber (Robin.Schreiber) * (Python triager) 日期: 2012-05-05 19:47
This patch presents my first try to apply the proposed Refactoring of PEP3121 to the csv module. I have identified three mutable global variables inside the module, two of which are references to PyObjects. I have wrapped all of them inside a dedicated struct, which is traversed by the gc after "freeing" the module. I also defined some macros, to hide functions calls that are now needed because of the newly introduced indirections.
msg160033 - (view) Author: Robin Schreiber (Robin.Schreiber) * (Python triager) 日期: 2012-05-05 19:49
The following script should fail before you have applied the bespoken patch: It basically checks wether one of the global PyObjects inside the csv module is being deleted after freeing the csv module.
msg160192 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) 日期: 2012-05-08 10:14
> Changes by Éric Araujo <merwok@netwok.org>:
>
>
> ----------
> nosy: +skip.montanaro

Thanks, but I'm out of the Python development business, except as it
pertains to my day job...

Skip
msg160200 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) 日期: 2012-05-08 12:33
PyModule_AddObject steals the value's reference, so you need to INCREF it before. Besides that, I don't see any obvious bug, but perhaps Martin wants to take a look.
msg160423 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) 日期: 2012-05-11 16:55
Skip: I used the nosy field autocomplete which is based on the experts file in the devguide; I can mark you "retired" in that file so that your name does not show up in autocomplete (but humans will still know that you might be contacted when all else fails, unless you prefer your name to be fully removed).
msg160425 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) 日期: 2012-05-11 17:03
> Skip: I used the nosy field autocomplete which is based on the experts file in the devguide; I can mark you "retired" in that file so that your name does not show up in autocomplete (but humans will still know that you might be contacted when all else fails, unless you prefer your name to be fully removed).

Thanks.  That would be great.  I don't mind the occasional question,
but don't want people thinking I am going to jump in feet first any
time I'm made nosy on a ticket.

S
msg160516 - (view) Author: Roundup Robot (python-dev) (Python triager) 日期: 2012-05-13 12:29
New changeset 90cf321615e5 by Antoine Pitrou in branch 'default':
Remove Skip from the csv experts (see issue #14732).
http://hg.python.org/devguide/rev/90cf321615e5
msg160818 - (view) Author: Roundup Robot (python-dev) (Python triager) 日期: 2012-05-16 09:35
New changeset 2496602a56e5 by Antoine Pitrou in branch 'default':
Issue #14732: The _csv module now uses PEP 3121 module initialization.
http://hg.python.org/cpython/rev/2496602a56e5
msg160819 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) 日期: 2012-05-16 09:36
Thanks for the updated patch, Robin. I have now committed it to the default branch.
msg160823 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) 日期: 2012-05-16 10:04
Robin, I forgot: could you please sign and send the contrib form at http://www.python.org/psf/contrib/ ?
It is not a copyright assignment, just a piece of paper that formally allows us to license your contribution for distribution with Python.
历史
日期 用户 动作 参数
2022-04-11 14:57:29admin修改github: 58937
2013-08-07 09:05:59belopolsky链接issue15787 dependencies
2012-05-16 10:04:09pitrou修改消息: + msg160823
2012-05-16 09:36:11pitrou修改状态: open -> closed
resolution: fixed
消息: + msg160819

stage: patch review -> resolved
2012-05-16 09:35:30python-dev修改消息: + msg160818
2012-05-13 12:29:43python-dev修改抄送: + python-dev
消息: + msg160516
2012-05-13 10:11:07Robin.Schreiber修改文件: + csv_pep3121_fix1.patch
2012-05-11 17:03:36skip.montanaro修改消息: + msg160425
2012-05-11 16:55:24eric.araujo修改抄送: + eric.araujo
消息: + msg160423
2012-05-08 12:33:02pitrou修改优先级: normal -> low

抄送: + pitrou
消息: + msg160200

stage: patch review
2012-05-08 10:14:28skip.montanaro修改抄送: + skip.montanaro
消息: + msg160192
2012-05-08 10:13:30skip.montanaro修改抄送: - skip.montanaro
2012-05-08 03:08:37eric.araujo修改抄送: + skip.montanaro
2012-05-05 20:21:35loewis修改抄送: + loewis
2012-05-05 19:49:43Robin.Schreiber修改文件: + refactoring_test.py

消息: + msg160033
2012-05-05 19:47:18Robin.Schreiber创建