]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
netutil: Preload the "latin1" codec 1910/head
authorA. Jesse Jiryu Davis <jesse@mongodb.com>
Sat, 10 Dec 2016 12:34:31 +0000 (07:34 -0500)
committerA. Jesse Jiryu Davis <jesse@mongodb.com>
Sat, 10 Dec 2016 12:34:47 +0000 (07:34 -0500)
For reasons not yet understood, some Solaris users get intermittent
"LookupError: unknown encoding: latin1", this has been reported to
fix it.

Fixes #584

tornado/netutil.py

index 7bf9321393019a77e0c992ee504633e0c66eba0e..20b4bdd63f62e6395ff60a36fd9900d96859f5f1 100644 (file)
@@ -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.