summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-08-05 22:41:57 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-08-05 22:41:57 +0200
commit7bc62fa42772b72f5a4f68729e6fc3aabfb909e8 (patch)
tree73661ee354e5403d61ca07dc96d8bec98d1b25f4 /python
parentbfa4d690e7262c19b2f0bfc3905177c37f42cf34 (diff)
parentad19dcb4f3608779551383103a23ccceb7df3e9c (diff)
downloadpython-apt-7bc62fa42772b72f5a4f68729e6fc3aabfb909e8.tar.gz
merged from debian-sid, fix crash in Dsc file handling
Diffstat (limited to 'python')
-rw-r--r--python/apt_pkgmodule.cc2
-rw-r--r--python/tag.cc5
2 files changed, 7 insertions, 0 deletions
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc
index a1e9ada0..cacbf77a 100644
--- a/python/apt_pkgmodule.cc
+++ b/python/apt_pkgmodule.cc
@@ -905,6 +905,8 @@ extern "C" void initapt_pkg()
Py_BuildValue("i", pkgAcquire::Item::StatFetching));
PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_DONE",
Py_BuildValue("i", pkgAcquire::Item::StatDone));
+ PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_TRANSIENT_NETWORK_ERROR",
+ Py_BuildValue("i", pkgAcquire::Item::StatTransientNetworkError));
PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_ERROR",
Py_BuildValue("i", pkgAcquire::Item::StatError));
PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_AUTH_ERROR",
diff --git a/python/tag.cc b/python/tag.cc
index 9fe12a1a..97039bc4 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -393,7 +393,12 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
return 0;
TagFileData *New = (TagFileData*)type->tp_alloc(type, 0);
+#ifdef APT_HAS_GZIP
+ new (&New->Fd) FileFd();
+ New->Fd.OpenDescriptor(fileno, FileFd::ReadOnlyGzip, false);
+#else
new (&New->Fd) FileFd(fileno,false);
+#endif
New->Owner = File;
Py_INCREF(New->Owner);
new (&New->Object) pkgTagFile(&New->Fd);