[Python-modules-commits] r23196 - in packages/python-dawg/trunk/debian/patches (2 files)
jwilk at users.alioth.debian.org
jwilk at users.alioth.debian.org
Thu Dec 20 22:39:25 UTC 2012
Date: Thursday, December 20, 2012 @ 22:39:23
Author: jwilk
Revision: 23196
Fix encoding issues in setup.py.
Added:
packages/python-dawg/trunk/debian/patches/fix-encoding-issues.diff
Modified:
packages/python-dawg/trunk/debian/patches/series
Added: packages/python-dawg/trunk/debian/patches/fix-encoding-issues.diff
===================================================================
--- packages/python-dawg/trunk/debian/patches/fix-encoding-issues.diff (rev 0)
+++ packages/python-dawg/trunk/debian/patches/fix-encoding-issues.diff 2012-12-20 22:39:23 UTC (rev 23196)
@@ -0,0 +1,30 @@
+Description: fix encoding issues in setup.py
+ setup.py tries to open UTF-8-encoded files without passing encoding to open(),
+ which fails with Python 3 and LC_ALL=C. This patch fixes this problem.
+Author: Jakub Wilk <jwilk at debian.org>
+Forwarded: no
+Last-Update: 2012-12-20
+
+--- a/setup.py
++++ b/setup.py
+@@ -3,11 +3,19 @@
+ from distutils.core import setup
+ from distutils.extension import Extension
+
++def read_utf8_file(path):
++ try:
++ file = open(path, encoding='utf8')
++ except TypeError:
++ file = open(path)
++ with file:
++ return file.read()
++
+ setup(
+ name="DAWG",
+ version="0.5.1",
+ description="Fast and memory efficient DAWG for Python",
+- long_description = open('README.rst').read() + open('CHANGES.rst').read(),
++ long_description = read_utf8_file('README.rst') + read_utf8_file('CHANGES.rst'),
+ author='Mikhail Korobov',
+ author_email='kmike84 at gmail.com',
+ url='https://github.com/kmike/DAWG/',
Modified: packages/python-dawg/trunk/debian/patches/series
===================================================================
--- packages/python-dawg/trunk/debian/patches/series 2012-12-20 22:23:58 UTC (rev 23195)
+++ packages/python-dawg/trunk/debian/patches/series 2012-12-20 22:39:23 UTC (rev 23196)
@@ -1 +1,2 @@
+fix-encoding-issues.diff
use-system-libraries.diff
More information about the Python-modules-commits
mailing list