Skip to content
Myr

Merge pull request #3580 from rbcarson/idna-thread-embedded-3578

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Add workaround to avoid implicit import of encodings.idna. Fixes #3578.

authored by Cory Benfield · committed by GitHub · parents 5524472, d7227fb · Browse files · 1 file+5 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−0 removed

  • other:+5 added−0 removed

1 file+5 added−0 removed

modified:requests/models.py+5 added
8 unmodified lines
910import collections11import datetime1213# Import encoding now, to avoid implicit import later.14# Implicit import within threads may cause LookupError when standard library is in a ZIP,15# such as in Embedded Python. See https://github.com/kennethreitz/requests/issues/3578.16import encodings.idna1718from io import BytesIO, UnsupportedOperation19from .hooks import default_hooks20from .structures import CaseInsensitiveDict21
866 unmodified lines