Merge "remove unicode from code"

This commit is contained in:
Zuul 2021-04-16 11:45:36 +00:00 committed by Gerrit Code Review
commit 2c067a916c
3 changed files with 7 additions and 7 deletions

View File

@ -38,7 +38,7 @@ openstackdocs_bug_tag = ''
master_doc = 'index'
# General information about the project.
copyright = u'2014, OpenStack Foundation'
copyright = '2014, OpenStack Foundation'
# -- Options for HTML output --------------------------------------------------

View File

@ -624,7 +624,7 @@ class JSONFormatterTestCase(LogTestBase):
expected = b'\\u2622'
# see ContextFormatterTestCase.test_can_process_strings
expected = '\\\\xe2\\\\x98\\\\xa2'
self.log.info(b'%s', u'\u2622'.encode('utf8'))
self.log.info(b'%s', '\u2622'.encode('utf8'))
self.assertIn(expected, self.stream.getvalue())
def test_exception(self):
@ -964,7 +964,7 @@ class ContextFormatterTestCase(LogTestBase):
"%(user_identity)s]: "
"%(message)s")
ctxt = _fake_context()
ctxt.request_id = u'99'
ctxt.request_id = '99'
message = 'test'
self.log.info(message, context=ctxt)
expected = ("HAS CONTEXT [%s %s %s %s %s %s]: %s\n" %
@ -981,7 +981,7 @@ class ContextFormatterTestCase(LogTestBase):
logging_user_identity_format="%(user)s "
"%(tenant)s")
ctxt = _fake_context()
ctxt.request_id = u'99'
ctxt.request_id = '99'
message = 'test'
self.log.info(message, context=ctxt)
expected = ("HAS CONTEXT [%s %s %s]: %s\n" %
@ -1024,7 +1024,7 @@ class ContextFormatterTestCase(LogTestBase):
# or it will fail and inserting byte string in unicode string
# causes such formatting
expected = '\\xe2\\x98\\xa2'
self.log.info(b'%s', u'\u2622'.encode('utf8'))
self.log.info(b'%s', '\u2622'.encode('utf8'))
self.assertIn(expected, self.stream.getvalue())
def test_dict_args_with_unicode(self):
@ -1923,7 +1923,7 @@ class KeywordArgumentAdapterTestCase(BaseTestCase):
class UnicodeConversionTestCase(BaseTestCase):
_MSG = u'Message with unicode char \ua000 in the middle'
_MSG = 'Message with unicode char \ua000 in the middle'
def test_ascii_to_unicode(self):
msg = self._MSG

View File

@ -31,7 +31,7 @@ extensions = [
master_doc = 'index'
# General information about the project.
copyright = u'2016, oslo.log Developers'
copyright = '2016, oslo.log Developers'
# Release notes do not need a version in the title, they span
# multiple versions.