Add workaround to avoid implicit import of encodings.idna.

This commit is contained in:
Carson Lam
2016-09-17 00:12:36 -07:00
parent 5524472cc7
commit d7227fbb7e
+5
View File
@@ -10,6 +10,11 @@ This module contains the primary objects that power Requests.
import collections
import datetime
# Import encoding now, to avoid implicit import later.
# Implicit import within threads may cause LookupError when standard library is in a ZIP,
# such as in Embedded Python. See https://github.com/kennethreitz/requests/issues/3578.
import encodings.idna
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict