From: A. Jesse Jiryu Davis Date: Sat, 10 Dec 2016 12:34:31 +0000 (-0500) Subject: netutil: Preload the "latin1" codec X-Git-Tag: v4.5.0~51^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0efe23ed1725af8017ef6af1f8c3aa31fee6fe55;p=thirdparty%2Ftornado.git netutil: Preload the "latin1" codec For reasons not yet understood, some Solaris users get intermittent "LookupError: unknown encoding: latin1", this has been reported to fix it. Fixes #584 --- diff --git a/tornado/netutil.py b/tornado/netutil.py index 7bf932139..20b4bdd63 100644 --- a/tornado/netutil.py +++ b/tornado/netutil.py @@ -96,6 +96,9 @@ else: # thread now. u'foo'.encode('idna') +# For undiagnosed reasons, 'latin1' codec may also need to be preloaded. +u'foo'.encode('latin1') + # These errnos indicate that a non-blocking operation must be retried # at a later time. On most platforms they're the same value, but on # some they differ.