[Python-modules-commits] r6509 - in packages/matplotlib/branches/lenny/debian (5 files)

morph-guest at users.alioth.debian.org morph-guest at users.alioth.debian.org
Mon Sep 15 19:12:19 UTC 2008


    Date: Monday, September 15, 2008 @ 19:12:17
  Author: morph-guest
Revision: 6509

adding Kumar Appaiah's changes

Added:
  packages/matplotlib/branches/lenny/debian/patches/manifest_add_doc.patch
  packages/matplotlib/branches/lenny/debian/patches/shared_axes_leak.patch
  packages/matplotlib/branches/lenny/debian/patches/ttconv_leak_fix.patch
Modified:
  packages/matplotlib/branches/lenny/debian/changelog
  packages/matplotlib/branches/lenny/debian/patches/series

Modified: packages/matplotlib/branches/lenny/debian/changelog
===================================================================
--- packages/matplotlib/branches/lenny/debian/changelog	2008-09-15 17:55:18 UTC (rev 6508)
+++ packages/matplotlib/branches/lenny/debian/changelog	2008-09-15 19:12:17 UTC (rev 6509)
@@ -1,3 +1,15 @@
+matplotlib (0.98.1-1+lenny1) testing-proposed-updates; urgency=low
+
+  [ Kumar Appaiah ]
+  * debian/patches/shared_axes_leak.patch
+    - Fix memory leak related to shared axes.
+  * debian/patches/ttconv_leak_fixes.patch
+    - Plug memory leaks in _ttconv.cpp.
+  * debian/patches/manifest_add_doc.patch
+    - Add the doc directory to MANIFEST.in.
+
+ -- Sandro Tosi <matrixhasu at gmail.com>  Mon, 15 Sep 2008 21:09:15 +0200
+
 matplotlib (0.98.1-1) unstable; urgency=low
 
   * New upstream release; Closes: #486074

Added: packages/matplotlib/branches/lenny/debian/patches/manifest_add_doc.patch
===================================================================
--- packages/matplotlib/branches/lenny/debian/patches/manifest_add_doc.patch	                        (rev 0)
+++ packages/matplotlib/branches/lenny/debian/patches/manifest_add_doc.patch	2008-09-15 19:12:17 UTC (rev 6509)
@@ -0,0 +1,12 @@
+Index: matplotlib-0.98.1/MANIFEST.in
+===================================================================
+--- matplotlib-0.98.1.orig/MANIFEST.in	2008-09-14 11:23:38.000000000 -0500
++++ matplotlib-0.98.1/MANIFEST.in	2008-09-14 11:24:01.000000000 -0500
+@@ -15,6 +15,7 @@
+ include lib/matplotlib/mpl-data/fonts/afm/*
+ recursive-include license LICENSE*
+ recursive-include examples *
++recursive-include doc *
+ recursive-include src  *.cpp *.c *.h
+ recursive-include CXX  *.cxx *.hxx *.c *.h
+ recursive-include agg24 *

Modified: packages/matplotlib/branches/lenny/debian/patches/series
===================================================================
--- packages/matplotlib/branches/lenny/debian/patches/series	2008-09-15 17:55:18 UTC (rev 6508)
+++ packages/matplotlib/branches/lenny/debian/patches/series	2008-09-15 19:12:17 UTC (rev 6509)
@@ -1,2 +1,5 @@
 build_fix.patch
 matplotlibrc_fix.patch
+shared_axes_leak.patch
+ttconv_leak_fix.patch
+manifest_add_doc.patch

Added: packages/matplotlib/branches/lenny/debian/patches/shared_axes_leak.patch
===================================================================
--- packages/matplotlib/branches/lenny/debian/patches/shared_axes_leak.patch	                        (rev 0)
+++ packages/matplotlib/branches/lenny/debian/patches/shared_axes_leak.patch	2008-09-15 19:12:17 UTC (rev 6509)
@@ -0,0 +1,84 @@
+Index: matplotlib-0.98.1/lib/matplotlib/cbook.py
+===================================================================
+--- matplotlib-0.98.1.orig/lib/matplotlib/cbook.py	2008-06-22 20:26:47.000000000 -0500
++++ matplotlib-0.98.1/lib/matplotlib/cbook.py	2008-09-13 19:46:39.000000000 -0500
+@@ -6,6 +6,7 @@
+ import re, os, errno, sys, StringIO, traceback, locale
+ import time, datetime
+ import numpy as np
++from weakref import ref
+ 
+ major, minor1, minor2, s, tmp = sys.version_info
+ 
+@@ -977,10 +978,20 @@
+     def __init__(self, init=[]):
+         mapping = self._mapping = {}
+         for x in init:
+-            mapping[x] = [x]
++            mapping[ref(x)] = [ref(x)]
+ 
+     def __contains__(self, item):
+-        return item in self._mapping
++        return ref(item) in self._mapping
++
++    def clean(self):
++        """
++        Clean dead weak references from the dictionary
++        """
++        mapping = self._mapping
++        for key, val in mapping.items():
++            if key() is None:
++                del mapping[key]
++                val.remove(key)
+ 
+     def join(self, a, *args):
+         """
+@@ -988,13 +999,13 @@
+         arguments.
+         """
+         mapping = self._mapping
+-        set_a = mapping.setdefault(a, [a])
++        set_a = mapping.setdefault(ref(a), [ref(a)])
+ 
+         for arg in args:
+-            set_b = mapping.get(arg)
++            set_b = mapping.get(ref(arg))
+             if set_b is None:
+-                set_a.append(arg)
+-                mapping[arg] = set_a
++                set_a.append(ref(arg))
++                mapping[ref(arg)] = set_a
+             elif set_b is not set_a:
+                 if len(set_b) > len(set_a):
+                     set_a, set_b = set_b, set_a
+@@ -1002,13 +1013,17 @@
+                 for elem in set_b:
+                     mapping[elem] = set_a
+ 
++        self.clean()
++
+     def joined(self, a, b):
+         """
+         Returns True if *a* and *b* are members of the same set.
+         """
++        self.clean()
++
+         mapping = self._mapping
+         try:
+-            return mapping[a] is mapping[b]
++            return mapping[ref(a)] is mapping[ref(b)]
+         except KeyError:
+             return False
+ 
+@@ -1026,7 +1041,10 @@
+         """
+         Returns all of the items joined with *a*, including itself.
+         """
+-        return self._mapping.get(a, [a])
++        self.clean()
++
++        siblings = self._mapping.get(ref(a), [ref(a)])
++        return [x() for x in siblings]
+ 
+ 
+ def simple_linear_interpolation(a, steps):

Added: packages/matplotlib/branches/lenny/debian/patches/ttconv_leak_fix.patch
===================================================================
--- packages/matplotlib/branches/lenny/debian/patches/ttconv_leak_fix.patch	                        (rev 0)
+++ packages/matplotlib/branches/lenny/debian/patches/ttconv_leak_fix.patch	2008-09-15 19:12:17 UTC (rev 6509)
@@ -0,0 +1,85 @@
+Index: matplotlib-0.98.1+lenny1/src/_ttconv.cpp
+===================================================================
+--- matplotlib-0.98.1+lenny1.orig/src/_ttconv.cpp	2008-09-13 20:27:06.000000000 -0500
++++ matplotlib-0.98.1+lenny1/src/_ttconv.cpp	2008-09-13 20:46:57.000000000 -0500
+@@ -25,22 +25,23 @@
+   }
+ 
+   ~PythonFileWriter() {
+-    if (_write_method)
+-      Py_DECREF(_write_method);
++    Py_XDECREF(_write_method);
+   }
+ 
+   void set(PyObject* write_method) {
+-    if (_write_method)
+-      Py_DECREF(_write_method);
++    Py_XDECREF(_write_method);
+     _write_method = write_method;
+-    if (_write_method)
+-      Py_INCREF(_write_method);
++    Py_XINCREF(_write_method);
+   }
+ 
+   virtual void write(const char* a) {
+-    if (_write_method)
+-      if (! PyObject_CallFunction(_write_method, (char *)"s", a))
+-	throw PythonExceptionOccurred();
++    PyObject* result = NULL;
++    if (_write_method) {
++      result = PyObject_CallFunction(_write_method, (char *)"s", a);
++      if (! result)
++        throw PythonExceptionOccurred();
++      Py_DECREF(result);
++    }
+   }
+ };
+ 
+@@ -54,6 +55,7 @@
+   }
+ 
+   file_writer->set(write_method);
++  Py_DECREF(write_method);
+ 
+   return 1;
+ }
+@@ -68,11 +70,14 @@
+   PyObject* item;
+   while ( (item = PyIter_Next(iterator)) ) {
+     long value = PyInt_AsLong(item);
++    Py_DECREF(item);
+     if (value == -1 && PyErr_Occurred())
+       return 0;
+     result->push_back(value);
+   }
+ 
++  Py_DECREF(iterator);
++
+   return 1;
+ }
+ 
+@@ -87,7 +92,7 @@
+     "filename", "output", "fonttype", "glyph_ids", NULL };
+   if (! PyArg_ParseTupleAndKeywords
+       (args, kwds,
+-       "sO&i|O&:convert_ttf_to_ps",
++       "s|O&:get_pdf_charprocs",
+        (char**)kwlist,
+        &filename,
+        fileobject_to_PythonFileWriter,
+@@ -130,9 +135,13 @@
+ 
+   virtual void add_pair(const char* a, const char* b) {
+     PyObject* value = PyString_FromString(b);
+-    if (value)
+-      if (PyDict_SetItemString(_dict, a, value))
++    if (value) {
++      if (PyDict_SetItemString(_dict, a, value)) {
++        Py_DECREF(value);
+ 	throw PythonExceptionOccurred();
++      }
++    }
++    Py_DECREF(value);
+   }
+ };
+ 




More information about the Python-modules-commits mailing list