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: Python memory cleaning
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.10
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: absvsb, gregory.p.smith
Priority: normal Keywords:

Created on 2021-03-01 21:09 by absvsb, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg387881 - (view) Author: absvsb (absvsb) Date: 2021-03-01 21:09
Sorry for my English. I don't know this is section is good for my question but anyway.
I know this is not a bug or etc. But this is really big problem for python users. As you know (maybe not) Qt company has released new Qt 6.0.1 for python. This is really big project and cool. I think this project has a big future. But at the same time there are some problems. One of them is memory security.
Like when I enter my password to password_line(echo_mode_hidden) and then search python memory for string I saw my password in memory area. Actually I dont know its python problem or PySide but this is a really problem. So my question is does foundation has a plan for solving this problem? Like some builts_in method for clearing specific variable data. Like user send variable name to the method and method clear its data. I will try some researching for clearing memory like send id(value) to c_dll and in c_dll side clean that memory but this is not a generic method...Sometimes gc clear that memory but sometimes not.
Thank you very much.
msg388601 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2021-03-13 10:18
CPython itself doesn't have guaranteed way to do this kind of thing.  There is no tracking of which types clear memory let alone which API calls may make copies of data in places within their C that are not explicitly cleared afterwards.  We do not have a plan to implement this.

For data that MUST NOT remain in memory in any form anywhere as soon as code is done with it, the best thing to do is isolate all code inputting, processing, and clearing that within the confines of a lower level extension module or a short lived subprocess.
History
Date User Action Args
2022-04-11 14:59:42adminsetgithub: 87523
2021-03-13 10:18:28gregory.p.smithsetstatus: open -> closed

type: security -> enhancement
versions: + Python 3.10, - Python 3.9
nosy: + gregory.p.smith

messages: + msg388601
resolution: rejected
stage: resolved
2021-03-01 21:09:43absvsbcreate