[Python-modules-commits] r16100 - in packages/objgraph/trunk/debian (5 files)

stefanor at users.alioth.debian.org stefanor at users.alioth.debian.org
Fri Mar 11 16:43:14 UTC 2011


    Date: Friday, March 11, 2011 @ 16:43:06
  Author: stefanor
Revision: 16100

* New upstream release.
  - Update copyright years.
  - utf8-changes.patch: Fix UnicodeDecodeError in non-UTF-8 locales
  - quoting-py3k-utf8.patch: Fix quoting.txt test for Py3k + non-UTF-8
    locales

Added:
  packages/objgraph/trunk/debian/patches/quoting-py3k-utf8.patch
  packages/objgraph/trunk/debian/patches/utf8-changes.patch
Modified:
  packages/objgraph/trunk/debian/changelog
  packages/objgraph/trunk/debian/copyright
  packages/objgraph/trunk/debian/patches/series

Modified: packages/objgraph/trunk/debian/changelog
===================================================================
--- packages/objgraph/trunk/debian/changelog	2011-03-11 15:19:04 UTC (rev 16099)
+++ packages/objgraph/trunk/debian/changelog	2011-03-11 16:43:06 UTC (rev 16100)
@@ -1,9 +1,14 @@
-objgraph (1.6.0-3) UNRELEASED; urgency=low
+objgraph (1.7.0-1) UNRELEASED; urgency=low
 
+  * New upstream release.
+    - Update copyright years.
+    - utf8-changes.patch: Fix UnicodeDecodeError in non-UTF-8 locales
+    - quoting-py3k-utf8.patch: Fix quoting.txt test for Py3k + non-UTF-8
+      locales
   * Update my e-mail address.
   * Correct DEP3 headers (first line of Description is the subject)
 
- -- Stefano Rivera <stefanor at debian.org>  Sat, 05 Feb 2011 11:46:09 +0200
+ -- Stefano Rivera <stefanor at debian.org>  Fri, 11 Mar 2011 18:41:55 +0200
 
 objgraph (1.6.0-2) unstable; urgency=low
 

Modified: packages/objgraph/trunk/debian/copyright
===================================================================
--- packages/objgraph/trunk/debian/copyright	2011-03-11 15:19:04 UTC (rev 16099)
+++ packages/objgraph/trunk/debian/copyright	2011-03-11 16:43:06 UTC (rev 16100)
@@ -4,7 +4,7 @@
 Source: http://pypi.python.org/pypi/objgraph/
 
 Files: *
-Copyright: 2008-2010, Marius Gedminas
+Copyright: 2008-2011, Marius Gedminas
 License: MIT
  Released under the MIT licence.
  .

Added: packages/objgraph/trunk/debian/patches/quoting-py3k-utf8.patch
===================================================================
--- packages/objgraph/trunk/debian/patches/quoting-py3k-utf8.patch	                        (rev 0)
+++ packages/objgraph/trunk/debian/patches/quoting-py3k-utf8.patch	2011-03-11 16:43:06 UTC (rev 16100)
@@ -0,0 +1,39 @@
+Description: Fix quoting.txt test for Py3k + non-UTF-8 locales
+ File objects are, by default, wrapped with an ASCII codec on Python 3.
+ Use UTF-8 explicitly.
+Author: Stefano Rivera <stefanor at debian.org>
+Forwarded: https://code.launchpad.net/~stefanor/objgraph/quoting-py3k-utf8/+merge/53041
+Last-Update: 2011-03-11
+
+--- a/objgraph.py
++++ b/objgraph.py
+@@ -33,6 +33,7 @@
+ __date__ = "2011-03-11"
+ 
+ 
++import codecs
+ import gc
+ import re
+ import inspect
+@@ -508,11 +509,20 @@
+     if not isinstance(objs, (list, tuple)):
+         objs = [objs]
+     if filename and filename.endswith('.dot'):
+-        f = open(filename, 'w')
++        try:
++            f = open(filename, 'w', encoding='UTF-8')
++        except TypeError:
++            # Python 2.x compatibility
++            f = codecs.open(filename, 'w', encoding='UTF-8')
+         dot_filename = filename
+     else:
+         fd, dot_filename = tempfile.mkstemp('.dot', text=True)
+         f = os.fdopen(fd, "w")
++        if f.encoding != None:
++            # Python 3 will wrap the file in the user's preferred encoding
++            # Re-wrap it for UTF-8
++            import io
++            f = io.TextIOWrapper(f.detach(), 'UTF-8')
+     f.write('digraph ObjectGraph {\n'
+             '  node[shape=box, style=filled, fillcolor=white];\n')
+     queue = []

Modified: packages/objgraph/trunk/debian/patches/series
===================================================================
--- packages/objgraph/trunk/debian/patches/series	2011-03-11 15:19:04 UTC (rev 16099)
+++ packages/objgraph/trunk/debian/patches/series	2011-03-11 16:43:06 UTC (rev 16100)
@@ -1 +1,3 @@
 excise-setuptools.diff
+utf8-changes.patch
+quoting-py3k-utf8.patch

Added: packages/objgraph/trunk/debian/patches/utf8-changes.patch
===================================================================
--- packages/objgraph/trunk/debian/patches/utf8-changes.patch	                        (rev 0)
+++ packages/objgraph/trunk/debian/patches/utf8-changes.patch	2011-03-11 16:43:06 UTC (rev 16100)
@@ -0,0 +1,32 @@
+Description: Fix UnicodeDecodeError in non-UTF-8 locales
+ CHANGES.txt contains non-ASCII characters.
+ Explicitly decode it as UTF-8.
+Author: Stefano Rivera <stefanor at debian.org>
+Forwarded: https://code.launchpad.net/~stefanor/objgraph/utf8-changes/+merge/53031
+Last-Update: 2011-03-11
+
+--- a/setup.py
++++ b/setup.py
+@@ -10,9 +10,9 @@
+ 
+ 
+ def read(filename):
+-    f = open(relative(filename))
++    f = open(relative(filename), 'rb')
+     try:
+-        return f.read()
++        return f.read().decode('utf-8')
+     finally:
+         f.close()
+ 
+@@ -34,7 +34,9 @@
+ def get_description():
+     readme = read('README.txt')
+     changelog = read('CHANGES.txt')
+-    return unsphinx(readme + '\n\n\n' + changelog)
++    description = unsphinx(readme + '\n\n\n' + changelog)
++    description = description.encode('ascii', 'replace').decode('ascii')
++    return description
+ 
+ 
+ def build_images(doctests=()):




More information about the Python-modules-commits mailing list