9352: TypeError: 'str' does not support the buffer interface (better solution)

This commit is contained in:
SNoiraud 2016-04-06 19:52:18 +02:00
parent b620d6a039
commit f5f024af53

View File

@ -455,7 +455,7 @@ def html_escape(text):
"""Convert the text and replace some characters with a &# variant.""" """Convert the text and replace some characters with a &# variant."""
# First single characters, no quotes # First single characters, no quotes
text = escape(str(text)) text = escape(text)
# Deal with double quotes. # Deal with double quotes.
m = _html_dbl_quotes.match(text) m = _html_dbl_quotes.match(text)
@ -5367,7 +5367,7 @@ class PersonPages(BasePage):
elif first_surname: elif first_surname:
first_surname = False first_surname = False
tcell += Html("a", html_escape(surname), tcell += Html("a", html_escape(surname),
title = "Surnames " + str(surname)) title = "Surnames " + surname)
else: else:
tcell += " " tcell += " "
@ -8718,8 +8718,8 @@ def sort_people(dbase, handle_list):
if primary_name.group_as: if primary_name.group_as:
surname = primary_name.group_as surname = primary_name.group_as
else: else:
surname = dbase.get_name_group_mapping( surname = str(dbase.get_name_group_mapping(
_nd.primary_surname(primary_name)) _nd.primary_surname(primary_name)))
# Treat people who have no name with those whose name is just # Treat people who have no name with those whose name is just
# 'whitespace' # 'whitespace'