python 2.1.2, Linux and 'os' library: bug or (bad) feature?
Fredrik Lundh
fredrik at pythonware.com
Tue Mar 19 10:41:32 EST 2002
Pawel Oleksik wrote:
> No way! And as I've written above: python 2.1.1,
> 2.1.0, and 2.0.1 work OK.
can you spot the bug?
$ more Python-2.1.1/Modules/posixmodule.c
static PyObject *
posix_system(PyObject *self, PyObject *args)
{
char *command;
long sts;
if (!PyArg_ParseTuple(args, "s:system", &command))
return NULL;
Py_BEGIN_ALLOW_THREADS
sts = system(command);
Py_END_ALLOW_THREADS
return PyInt_FromLong(sts);
}
$ more Python-2.1.2/Modules/posixmodule.c
static PyObject *
posix_system(PyObject *self, PyObject *args)
{
char *command;
long sts;
if (!PyArg_ParseTuple(args, "s:system", &command))
return NULL;
Py_BEGIN_ALLOW_THREADS
sts = system(command);
Py_END_ALLOW_THREADS
return PyInt_FromLong(sts);
}
</F>
More information about the Python-list
mailing list