[Patches] [ python-Patches-569139 ] Implementation of st_rdev_pair
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 14 Jun 2002 14:36:10 -0700
Patches item #569139, was opened at 2002-06-14 14:53
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=569139&group_id=5470
Category: Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gustavo Niemeyer (niemeyer)
Assigned to: Nobody/Anonymous (nobody)
Summary: Implementation of st_rdev_pair
Initial Comment:
As discussed in python-dev, st_rdev provides an integer, which
usually needs to be translated in a (major, minor) pair before it's
useful. There are no implementations of major() and minor() in the
current library, and maybe there shouldn't be, since their functionality
is not portable.
This patch provides a portable way to access this information, by
providing a new attribute to the os.stat() return tuple named
st_rdev_pair.
----------------------------------------------------------------------
>Comment By: Neal Norwitz (nnorwitz)
Date: 2002-06-14 17:36
Message:
Logged In: YES
user_id=33168
Are major/minor guaranteed to exist?
Should a check be added to configure?
There is a missing DECREF.
In the last line of the patch to posixmodule.c,
there is if (PyErr_Occurred()) {
In that block, w needs to be DECREFed.
You can initialize w = NULL in the declaration,
then do an XDECREF in the error block.
That way you don't need to handle the error
creating w, if w != NULL, set the items in the tuple.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=569139&group_id=5470