Hey all, I’m making some network request on R8 using python 2.7. I noticed that if the network request is made immediately when the plugin starts to run, I have a chance of running into this exception particularly on Windows:
2024-10-19 08:43:56,961 - __main__ - ERROR - Traceback (most recent call last):
File "G:\My Drive\test.py", line 850, in thread_function
result = self._make_api_request(path, payload_dict, method)
File "G:\My Drive\test.py", line 831, in _make_api_request
response_data = response.read()
File "<string>", line 53, in __ironpy_tracefunc__
NameError: global name '__transformers__' is not defined
If I retry this again in 1s, it will work. Here is the snippet:
# Get the response
response = urllib2.urlopen(req)
# Read the response and parse JSON
response_data = response.read()
response_dict = json.loads(response_data)
These code are running on a separate thread. Any ideas? Thanks!
Hey Nathan, sorry this seems to be an issue only if I have a breakpoint in the script editor. Otherwise, it works fine. I will focus on finishing the plugin and work on a snippet later this week. Thanks!