Skip to content

handle case when non-ascii char are logged#188

Merged
solarkennedy merged 1 commit intothefactory:masterfrom
tgermain:dev/tg/ascii
Apr 12, 2017
Merged

handle case when non-ascii char are logged#188
solarkennedy merged 1 commit intothefactory:masterfrom
tgermain:dev/tg/ascii

Conversation

@tgermain
Copy link
Copy Markdown

Fix #187 by encoding response in utf-8 before logging it.

It could also be done for the whole logger but I have no idea how right now.

@solarkennedy
Copy link
Copy Markdown
Contributor

How about

logging._defaultFormatter = logging.Formatter(u"%(message)s")

in init.py?

@tgermain
Copy link
Copy Markdown
Author

It's not the log itself but the "{}".format(u'\xe7\xe7') inside the log. We are trying to put a utf-8 string into a non-utf-8 string.

u"{}".format(u'\xe7\xe7') seems to do the job. I don't know with solution is better, thoughts @solarkennedy ?

I tried to change the default formatter, the issue remain.

@solarkennedy
Copy link
Copy Markdown
Contributor

Oh, I understand now (I think). No I think this patch is ok.

@solarkennedy solarkennedy merged commit d331818 into thefactory:master Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants