from future.standard_library import hooks
with hooks():
from urllib.parse import urlparse, urlencode
from urllib.request import urlopen, Request
from urllib.error import HTTPError
This code made from mymodule import * fail. That is, it runs, but nothing gets imported into the module running that, as if mymodule is empty. Later calls to from mymodule import *, e.g. in a debuger, do work. My guess is the issue is something to do with copying and then re-inserting stuff from sys.modules that the install_hooks-related code does; probably modules are being copied at the wrong time, when they're still half-empty or something.
This code made
from mymodule import *fail. That is, it runs, but nothing gets imported into the module running that, as ifmymoduleis empty. Later calls tofrom mymodule import *, e.g. in a debuger, do work. My guess is the issue is something to do with copying and then re-inserting stuff fromsys.modulesthat theinstall_hooks-related code does; probably modules are being copied at the wrong time, when they're still half-empty or something.