Accepting request 206770 from devel:languages:python

- Add sphinx-setup_command_unicode.patch: Backport of 
  https://bitbucket.org/birkenfeld/sphinx/pull-request/193/

OBS-URL: https://build.opensuse.org/request/show/206770
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Sphinx?expand=0&rev=25
This commit is contained in:
Stephan Kulow 2013-11-14 07:43:32 +00:00 committed by Git OBS Bridge
commit 91f45ec0c0
3 changed files with 40 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Nov 13 14:54:09 UTC 2013 - speilicke@suse.com
- Add sphinx-setup_command_unicode.patch: Backport of
https://bitbucket.org/birkenfeld/sphinx/pull-request/193/
-------------------------------------------------------------------
Wed Nov 6 08:10:01 UTC 2013 - speilicke@suse.com

View File

@ -24,6 +24,8 @@ Summary: Python documentation generator
License: BSD-2-Clause
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz
# PATCH-FIX-UPSTREAM speilicke@suse.com -- Backport of https://bitbucket.org/birkenfeld/sphinx/pull-request/193/
Patch0: sphinx-setup_command_unicode.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-setuptools
@ -78,6 +80,7 @@ and translating suite, the Docutils.
%prep
%setup -q -n Sphinx-%{version}
%patch0 -p1
sed -i '/#\!/d' sphinx/pycode/pgen2/token.py # Fix non-excutable-script warning
# Add Interpreter version suffix to entrypoints (and thus /usr/bin binaries) to
# allow for update-alternatives later on:

View File

@ -0,0 +1,31 @@
diff -r 86e59496553b sphinx/setup_command.py
--- a/sphinx/setup_command.py Tue Nov 12 15:17:09 2013 +0000
+++ b/sphinx/setup_command.py Wed Nov 13 15:41:12 2013 +0100
@@ -14,6 +14,7 @@
import sys
import os
+import types
from StringIO import StringIO
from distutils.cmd import Command
@@ -98,6 +99,19 @@
return root
return None
+ # Overriding distutils' Command._ensure_stringlike which doesn't support
+ # unicode, causing finalize_options to fail if invoked again. Workaround
+ # for http://bugs.python.org/issue19570
+ def _ensure_stringlike(self, option, what, default=None):
+ val = getattr(self, option)
+ if val is None:
+ setattr(self, option, default)
+ return default
+ elif not isinstance(val, types.StringTypes):
+ raise DistutilsOptionError("'%s' must be a %s (got `%s`)"
+ % (option, what, val))
+ return val
+
def finalize_options(self):
if self.source_dir is None:
self.source_dir = self._guess_source_dir()