Skip to content

Commit

Permalink
Explicitly import html.parser for Cx_Freeze to build
Browse files Browse the repository at this point in the history
The markdown dependency uses importlib to monkeypatch 'html.parser'
[1]. Due to this approach 'html.parser' is never explicitly stated
as a dependency. This works fine in most cases, since it's part of
the python standard lib. But on Windows the build tool (CxFreeze)
ships in the .exe only the modules needed. And because html.parser
is never mentioned, it fails with an error (see issue #501).

Fixes #501

[1]: https://github.com/Python-Markdown/markdown/blob/master/markdown/htmlparser.py#L29
  • Loading branch information
deeplow committed Aug 5, 2023
1 parent b7e212e commit e8b28d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dangerzone/gui/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
except ImportError:
from PySide2 import QtCore, QtWidgets

# XXX implict import for "markdown" module required for Cx_Freeze to build on Windows
# See https://github.com/freedomofpress/dangerzone/issues/501
import html.parser

import markdown
import requests

Expand Down

0 comments on commit e8b28d6

Please sign in to comment.