Issue 5990: Memory leak in os.rename() and other functions (original) (raw)

Issue5990

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.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/50240

classification

Title: Memory leak in os.rename() and other functions
Type: resource usage Stage: patch review
Components: Library (Lib) Versions: Python 3.1

process

Status: closed Resolution: fixed
Dependencies: 6012 Superseder:
Assigned To: Nosy List: loewis, ocean-city, pitrou
Priority: high Keywords: patch

Created on 2009-05-10 20:44 by pitrou, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
os_leak.patch pitrou,2009-05-10 20:44
Messages (4)
msg87543 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-10 20:44
A small memory leak appeared in test_os with the PEP 383 checkins. The leak occurs in test_rename and is due to posix_2str. Here is a patch.
msg87553 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-10 22:28
Committed in r72556.
msg87562 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-05-11 05:17
The problem is more general. It can always happen that another argument conversion fails after the O& conversion had failed. Instead of going through the code and fixing each and every usage of the FSConverter callback, I'd rather want to discuss a more general solution, where PyArg_ParseTuple will invoke cleanup itself.
msg87678 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2009-05-13 11:47
I opened #6012 to handle O& memory leak issue.
History
Date User Action Args
2022-04-11 14:56:48 admin set github: 50240
2009-05-13 15:09:47 pitrou set dependencies: + enhance getargs O& to accept cleanup function
2009-05-13 11:47:23 ocean-city set nosy: + ocean-citymessages: +
2009-05-11 05🔞56 loewis set messages: +
2009-05-10 22:28:43 pitrou set status: open -> closedresolution: fixedmessages: +
2009-05-10 20:45:25 pitrou link issue5596 dependencies
2009-05-10 20:44:52 pitrou create

Supported by The Python Software Foundation,
Powered by Roundup

Copyright © 1990-2022, Python Software Foundation
Legal Statements