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: Fix for memory leak in WindowsError_str
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: nnorwitz, zseil
Priority: normal Keywords: patch

Created on 2006-06-02 20:46 by zseil, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
winerror_str.diff zseil, 2006-06-02 20:46 patch against revision 46603
Messages (2)
msg50409 - (view) Author: Ziga Seilnacht (zseil) * (Python committer) Date: 2006-06-02 20:46
The same memory leak that Neal Norwitz found in
EnvironmentError_str is also present in
WindowsError_str.

How to reproduce:

Python 2.5a2 (trunk:46603M, Jun  2 2006, 22:37:47)
  ...
>>> e = WindowsError(1, 'message', 'filename')
[27062 refs]
>>> s = str(e)
[27065 refs]
>>> s = str(e)
[27066 refs]
>>> s = str(e)
[27067 refs]
>>> del e.filename
[27066 refs]
>>> s = str(e)
[27066 refs]
>>> s = str(e)
[27066 refs]
>>> s = str(e)
[27066 refs]

This simple patch fixes it.
msg50410 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-06-04 06:20
Logged In: YES 
user_id=33168

Thanks!

Committed revision 46639.
History
Date User Action Args
2022-04-11 14:56:17adminsetgithub: 43449
2006-06-02 20:46:24zseilcreate