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.

Author baikie
Recipients baikie
Date 2009-01-07.22:30:39
SpamBayes Score 0.004416495
Marked as misclassified No
Message-id <1231367446.48.0.542903635557.issue4873@psf.upfronthosting.co.za>
In-reply-to
Content
When investigating issue #4859 I found that when pwd.getpwall()
and grp.getgrall() fail due to decoding errors, they leave open
file descriptors referring to the passwd and group files, since
they don't call the end*ent() functions in this case.  Also, the
grp.* functions have a reference counting error when they fail in
this way - a debug build reports that an object's reference count
goes to -1.  What I think happens is that in mkgrent(),
PyStructSequence_SET_ITEM steals the reference to "w", meaning
that the "Py_DECREF(w)" call shouldn't be made afterwards.  The
attached diff fixes both of these problems, I think, and applies
to the 2.x and 3.x branches.
History
Date User Action Args
2009-01-07 22:30:49baikiesetrecipients: + baikie
2009-01-07 22:30:46baikiesetmessageid: <1231367446.48.0.542903635557.issue4873@psf.upfronthosting.co.za>
2009-01-07 22:30:45baikielinkissue4873 messages
2009-01-07 22:30:40baikiecreate