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.
Created on 2017年06月08日 10:48 by vstinner, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 1998 | merged | vstinner, 2017年06月08日 11:10 | |
| Messages (7) | |||
|---|---|---|---|
| msg295399 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年06月08日 10:48 | |
Recently, the Python initialization was reworked to start to implement the PEP 432: - bpo-22257: commits 1abcf6700b4da6207fe859de40c6c1bada6b4fec and 6b4be195cd8868b76eb6fbe166acc39beee8ce36 Now, Py_NewInterpreter() leaks a reference on warnoptions in _PySys_EndInit(). We tried with Stéphane Wirtel and Louie Lu to add Py_DECREF(warnoptions), but test_capi does crash with this change. The problem is that warnoptions is stored in a C global variable *and* in sys.warnoptions of each interpreter. The ownership of this variable is unclear. I don't think that it's a good idea to share a list between two interpreters and so I created this issue to propose to redesign this variable. The tricky part is that the C global variable is also accessed by 2 public C functions: PySys_ResetWarnOptions() and PySys_AddWarnOptionUnicode(). |
|||
| msg295404 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2017年06月08日 11:04 | |
I'd suggest that the right fix here would be to move warnoptions into the config struct as proposed in the PEP: https://www.python.org/dev/peps/pep-0432/#supported-configuration-settings The main reason we merged this as a private API was so we could do that setting-by-setting, with the test suite ensuring we weren't breaking anything. It looks like in this case, it's the status quo that's broken, and the change makes it possible to fix it :) |
|||
| msg295405 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年06月08日 11:11 | |
See also bpo-30547 for other refleaks somehow related to that one. |
|||
| msg295410 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年06月08日 11:27 | |
New changeset 865de27dd79571a4a5c7a7d22a07fb909c4a9f8e by Victor Stinner in branch 'master': bpo-30598: _PySys_EndInit() now duplicates warnoptions (#1998) https://github.com/python/cpython/commit/865de27dd79571a4a5c7a7d22a07fb909c4a9f8e |
|||
| msg296409 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年06月20日 10:21 | |
Nick: "I'd suggest that the right fix here would be to move warnoptions into the config struct as proposed in the PEP: https://www.python.org/dev/peps/pep-0432/#supported-configuration-settings" Nick, Eric: do you want to do that it? If you are busy, that's fine, I will just close the issue since my concern (the ref leak) is now fixed. |
|||
| msg296517 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2017年06月21日 04:55 | |
We'll likely still move it eventually, but I don't think that's a good reason to keep this issue open - it's more a part of making incremental progress towards being able to make PEP 432 a public API. |
|||
| msg301890 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年09月11日 17:14 | |
This bug came back in master: see bpo-31420. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:47 | admin | set | github: 74783 |
| 2017年09月11日 17:14:37 | vstinner | set | messages: + msg301890 |
| 2017年06月21日 04:55:16 | ncoghlan | set | status: open -> closed resolution: fixed messages: + msg296517 stage: resolved |
| 2017年06月20日 10:21:39 | vstinner | set | messages: + msg296409 |
| 2017年06月08日 11:27:49 | vstinner | set | messages: + msg295410 |
| 2017年06月08日 11:11:37 | vstinner | set | messages: + msg295405 |
| 2017年06月08日 11:10:11 | vstinner | set | pull_requests: + pull_request2064 |
| 2017年06月08日 11:04:18 | ncoghlan | set | messages: + msg295404 |
| 2017年06月08日 10:48:40 | vstinner | create | |