mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-01 18:18:31 +00:00
Minor py3k compatibility changes: iteritems() doesn't exist on Python 3.x, logged text must be Unicode.
This commit is contained in:
parent
0d8fa5db6b
commit
485e375139
2 changed files with 6 additions and 2 deletions
|
@ -190,7 +190,11 @@ class Application(object):
|
|||
|
||||
# Set content length
|
||||
if answer:
|
||||
log.LOGGER.debug("Response content:\n%s" % answer)
|
||||
# decoding the answer for logging purposes on Python 3
|
||||
log_answer = answer
|
||||
if not isinstance(log_answer, str):
|
||||
log_answer = log_answer.decode(config.get("encoding", "request"))
|
||||
log.LOGGER.debug("Response content:\n%s" % log_answer)
|
||||
headers["Content-Length"] = "%i" % len(answer)
|
||||
|
||||
# Start response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue