On Python 2 we don't need to convert byte keys to unicode.

This commit is contained in:
Itamar Turner-Trauring 2021-07-05 16:35:06 -07:00
parent 203652d087
commit af49dcb89e

View File

@ -18,7 +18,14 @@ from pyutil import nummedobj
from foolscap.logging import log from foolscap.logging import log
from twisted.python import log as tw_log from twisted.python import log as tw_log
from .jsonbytes import bytes_to_unicode if PY2:
def bytes_to_unicode(ign, obj):
return obj
else:
# We want to convert bytes keys to Unicode, otherwise JSON serialization
# inside foolscap will fail (for details see
# https://github.com/warner/foolscap/issues/88)
from .jsonbytes import bytes_to_unicode
NOISY = log.NOISY # 10 NOISY = log.NOISY # 10