python3: Fix unicode strings
Python3 enforces the distinction between byte strings and text strings more rigorously than python2. So use six.text_type where approiate. Change-Id: I46b3f5fe1f990fc1b7a3ee32904d608b070fc4c3 Signed-off-by: Chuck Short <chuck.short@canonical.com>
This commit is contained in:

committed by
Gerrit Code Review

parent
9ab7cdcef9
commit
dc1105ebca
@@ -278,7 +278,7 @@ def slugify(value):
|
|||||||
"""
|
"""
|
||||||
import unicodedata
|
import unicodedata
|
||||||
if not isinstance(value, unicode):
|
if not isinstance(value, unicode):
|
||||||
value = unicode(value)
|
value = six.text_type(value)
|
||||||
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')
|
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')
|
||||||
value = unicode(_slugify_strip_re.sub('', value).strip().lower())
|
value = six.text_type(_slugify_strip_re.sub('', value).strip().lower())
|
||||||
return _slugify_hyphenate_re.sub('-', value)
|
return _slugify_hyphenate_re.sub('-', value)
|
||||||
|
@@ -42,8 +42,8 @@ source_suffix = '.rst'
|
|||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'python-cinderclient'
|
project = 'python-cinderclient'
|
||||||
copyright = u'Rackspace, based on work by Jacob Kaplan-Moss'
|
copyright = 'Rackspace, based on work by Jacob Kaplan-Moss'
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
@@ -179,8 +179,8 @@ htmlhelp_basename = 'python-cinderclientdoc'
|
|||||||
# (source start file, target name, title, author, documentclass [howto/manual])
|
# (source start file, target name, title, author, documentclass [howto/manual])
|
||||||
# .
|
# .
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index', 'python-cinderclient.tex', u'python-cinderclient Documentation',
|
('index', 'python-cinderclient.tex', 'python-cinderclient Documentation',
|
||||||
u'Rackspace - based on work by Jacob Kaplan-Moss', 'manual'),
|
'Rackspace - based on work by Jacob Kaplan-Moss', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
|
Reference in New Issue
Block a user