summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2012-06-17 23:11:16 +0200
committerJulian Andres Klode <jak@debian.org>2012-06-17 23:11:16 +0200
commit4133baa95eaf2a8638c2ad8acea42e061049db02 (patch)
tree8c40ad438c639600248e97c7393a564323d2d280
parent0d6a27849d413e421c3b694a80582080c35d6fd4 (diff)
downloadpython-apt-4133baa95eaf2a8638c2ad8acea42e061049db02.tar.gz
* python/tag.cc:
- Correctly handle file descriptor 0 aka stdin (Closes: #669458)
-rw-r--r--debian/changelog2
-rw-r--r--python/tag.cc4
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;