[Patches] [ python-Patches-798534 ] Windows os.popen needlessly gets a reference to tuple ()

SourceForge.net noreply at sourceforge.net
Mon Sep 1 16:37:56 EDT 2003


Patches item #798534, was opened at 2003-09-01 07:48
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=798534&group_id=5470

Category: None
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Andrew Gaul (gaul)
Assigned to: Nobody/Anonymous (nobody)
Summary: Windows os.popen needlessly gets a reference to tuple ()

Initial Comment:
Windows os.popen creates a zero length tuple and does
not use or destroy it.  Warning: attached patch has not
been tested!  I do not have a Windows development
environment.

Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for
more information.
>>> import os, sys
>>> sys.getrefcount(())
440
>>> p = os.popen('dir')
>>> sys.getrefcount(())
441
>>> p = os.popen('dir')
>>> sys.getrefcount(())
442

----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-09-01 17:37

Message:
Logged In: YES 
user_id=80475

Applied as:
  Modules/posixmodule.c 2.302 and 2.300.8.2

Thanks for the patch :-)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=798534&group_id=5470



More information about the Patches mailing list