diff options
| -rw-r--r-- | debian/changelog | 2 | ||||
| -rw-r--r-- | python/tag.cc | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index 2bb0c431..771fed36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -47,6 +47,8 @@ python-apt (0.8.5) UNRELEASED; urgency=low - Handle the use of "del" on configuration values. Those are represented by calling the setter with NULL, which we did not handle before, causing a segmentation fault (Closes: #661062) + * python/tag.cc: + - Correctly handle file descriptor 0 aka stdin (Closes: #669458) -- Michael Vogt <mvo@debian.org> Tue, 17 Apr 2012 14:09:24 +0200 diff --git a/python/tag.cc b/python/tag.cc index bf79debf..248d818d 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -461,7 +461,7 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) } New = (TagFileData*)type->tp_alloc(type, 0); - if (fileno > 0) + if (fileno != -1) { #ifdef APT_HAS_GZIP new (&New->Fd) FileFd(); @@ -483,7 +483,7 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) New->Owner = File; Py_INCREF(New->Owner); #if PY_MAJOR_VERSION >= 3 - if (fileno > 0) { + if (fileno != -1) { New->Encoding = PyObject_GetAttr(File, PyUnicode_FromString("encoding")); if (New->Encoding && !PyUnicode_Check(New->Encoding)) New->Encoding = 0; |
