Thanks bwoodsend,

Your response point me to a workaround... It's sufficient to force 
"pyinstaller" to load "html.parser"...

Either in pyinstaller command line

'''
pyinstaller.exe -y --hidden-import html.parser hello.py
'''

or in the source code.

'''
import sys
import markdown
from markdown.__meta__ import __version_info__
from html import parser # unused but force pyinstaller to load 
"html.parser", needed by markdown 3.3.0

print("Python version  %s" % sys.version)
print("Version info    %s" % str(sys.version_info))
print("Markdown version %s" % str(__version_info__))

print(markdown.markdown('# hello'))
'''

'''
Python version  3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC 
v.1927 64 bit (AMD64)]
Version info    sys.version_info(major=3, minor=9, micro=0, 
releaselevel='final', serial=0)
Markdown version (3, 3, 3, 'final', 0)
<h1>hello</h1>
'''

Thanks,
Francois.

Le dimanche 25 octobre 2020 à 18:42:42 UTC+1, bwoodsend a écrit :

> Well the offending code is inside markdown/htmlparser.py which has been 
> rather nastily monkey-patched.
>
> # Import a copy of the html.parser lib as `htmlparser` so we can monkeypatch 
> it.# Users can still do `from html import parser` and get the default 
> behavior.
> spec = importlib.util.find_spec('html.parser')
> htmlparser = importlib.util.module_from_spec(spec)
> spec.loader.exec_module(htmlparser)
> sys.modules['htmlparser'] = htmlparser
>
> Currently there is no support for importlib.util.find_spec()in 
> PyInstaller and nothing we have can force it to work. So no is the answer. 
> You’ll have to stick to pip install markdown<3.3.0. Fell free to raise 
> this as an issue on the hooks repo 
> <http://github.com/pyinstaller/pyinstaller-hooks-contrib/> but as this 
> would be a simple fix for markdown or a very difficult fix for us I doubt 
> it’ll get much attention. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/efcd76a8-50e6-4ccc-9a9b-64362105d947n%40googlegroups.com.

Reply via email to