`WhatsThis` triggering SSL error while opening help pages isn't caught
- Dominant language
- C++
- Stars
- 33.6k
- Forks
- 6k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 196
Description
### Problem description
For whatever reason, on my system urllib isn't using the cacert.pem that's bundled with FreeCAD, and trying to get to a wiki help page via the WhatsThis button halts on an uncaught exception.
Catching it would at least let the code show the english version of such a page when trying to determine if a localized version should be used instead.
### Workbench affected?
_No response_
### Steps to reproduce
Find a way to have the certificate check fail when trying to get to a wiki page via the WhatsThis button - I don't know why it happens for me and no idea how someone else would get in that scenario.
### Expected behavior
The program catches the exception but still tries to open the system browser at the english version of the desired wiki.
### Actual behavior
This code fails to catch the SSL exception and the code just stops executing: https://github.com/FreeCAD/FreeCAD/blob/main/src/Mod/Help/Help.py#L180-L181
This is a sample of the output I get in the report view:
```
12:57:49 pyException: Traceback (most recent call last):
File "", line 1, in
File "C:\Standalone\Freecad Versions\FreeCAD Weekly\Mod\Help\Help.py", line 106, in show
location, _pagename = get_location(page)
^^^^^^^^^^^^^^^^^^
File "C:\Standalone\Freecad Versions\FreeCAD Weekly\Mod\Help\Help.py", line 207, in get_location
location, pagename = location_url(WIKI_URL + "/" + page + suffix, WIKI_URL + "/" + page)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Standalone\Freecad Versions\FreeCAD Weekly\Mod\Help\Help.py", line 169, in location_url
with urllib.request.urlopen(req) as response:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Standalone\Freecad Versions\FreeCAD weekly\bin\Lib\urllib\request.py", line 216, in urlopen
return opener.open(url, data, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Standalone\Freecad Versions\FreeCAD weekly\bin\Lib\urllib\request.py", line 519, in open
response = self._open(req, data)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Standalone\Freecad Versions\FreeCAD weekly\bin\Lib\urllib\request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Standalone\Freecad Versions\FreeCAD weekly\bin\Lib\urllib\request.py", line 496, in _call_chain
result = func(*args)
^^^^^^^^^^^
File "C:\Standalone\Freecad Versions\FreeCAD weekly\bin\Lib\urllib\request.py", line 1391, in https_open
return self.do_open(http.client.HTTPSConnection, req,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Standalone\Freecad Versions\FreeCAD weekly\bin\Lib\urllib\request.py", line 1351, in do_open
raise URLError(err)
:
```
On my end as temporary workaround I just changed this...
```
except urllib.error.HTTPError as e:
return (url_english, "")
```
...into this, catching any and all possible exceptions there:
```
except urllib.error.HTTPError as e:
return (url_english, "")
except BaseException as e:
print(e)
return (url_english, "")
```
### Development version About Info (in Safe Mode)
```shell
OS: Windows 10 build 19045
Architecture: x86_64
Version: 26.3.0dev.20260812 (Git shallow)
Build date: 2026/08/12 05:41:29
Build type: Release
Branch: (HEAD detached at dc1ef6e88)
Hash: dc1ef6e880d6f5cf5d5a6eb3749373141eb0deb8
Python 3.11.14, Qt 6.8.3, Coin 4.0.10 (bundled), Pivy 0.6.11 (bundled), Vtk 9.3.1, boost 1_86, Eigen3 3.4.0, PySide 6.8.3
shiboken 6.8.3, xerces-c 3.3.0, Clipper2 , IfcOpenShell 0.8.2, OCC 7.8.1
Locale: English/United States (en_US) [ OS: English/United States (en_US) ]
Stylesheet/Theme/QtStyle: FreeCAD.qss/FreeCAD Dark/
QPA/File dialog/Color dialog: windows/via Win32/via Qt
Navigation Style/Orbit Style/Rotation Mode: CAD/Rounded Arcball/Window center
Logical DPI/Physical DPI/Pixel Ratio: 96/81.5973/1
OpenGL version/vendor/renderer: 4.6.0 NVIDIA 591.74/NVIDIA Corporation/NVIDIA GeForce RTX 3060/PCIe/SSE2
```
### Last known good version (optional)
```shell
```
Contributor guide
Research direction
Start in src/Mod/Help/Help.py, especially location_url around the reported urllib.request.urlopen call and get_location. Reproduce or simulate the certificate failure while opening a WhatsThis help page, then verify that the English wiki URL is returned and opened in the system browser instead of execution stopping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100