biolab / biolab/orange3

No internet connection problem with add-on manager

Open
#6,744 14 comments 0 reactions 0 assignees View on GitHub
bug report
Dominant language
Python
Stars
5.7k
Forks
1.1k
Avg merge
12d 2h
Merged PRs (30d)
1

Description

**What's wrong?**

```
There's an issue with the internet connection.

Traceback (most recent call last):
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/orangecanvas/application/addons.py", line 510, in
lambda config=config: (config, list_available_versions(config)),
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/orangecanvas/application/utils/addons.py", line 369, in list_available_versions
response = session.get(PYPI_API_JSON.format(name=p))
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/session.py", line 102, in get
return self.request('GET', url, params=params, **kwargs)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/session.py", line 158, in request
return super().request(method, url, *args, headers=headers, **kwargs) # type: ignore
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/session.py", line 194, in send
actions.update_from_cached_response(cached_response, self.cache.create_key, **kwargs)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/policy/actions.py", line 184, in update_from_cached_response
usable_response = self.is_usable(cached_response)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/policy/actions.py", line 152, in is_usable
or (cached_response.is_expired and self._stale_while_revalidate is True)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/models/response.py", line 149, in is_expired
return self.expires is not None and datetime.utcnow() >= self.expires
TypeError: can't compare offset-naive and offset-aware datetimes

```

![image](https://github.com/biolab/orange3/assets/13569029/c828afa7-0275-44f4-8c2d-c277a1f2a2c2)

**How can we reproduce the problem?**

Go to Options > Add-ons

**What's your environment?**

- Operating system: Mac OSX Sonoma 14.2.1
- Orange version: 3.36.1 (but I experienced the same issue on 3.36.2 as well but it did not give the detailed stack trace of the error)
- How you installed Orange: .dmg downloaded from website (**I do not experience this issue when installing via pip**)
- Apple M1 Pro (2021)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the error through Options > Add-ons, then inspect orangecanvas/application/addons.py around the list_available_versions call and orangecanvas/application/utils/addons.py at the reported request path. Verify the behavior against the displayed traceback and confirm that the add-on manager handles this connection case without the reported datetime TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.