Python-Markdown / markdown

A Python implementation of John Gruber’s Markdown with Extension support.
https://python-markdown.github.io/
BSD 3-Clause "New" or "Revised" License
3.79k stars 863 forks source link

Error under python 3.8: AttributeError: 'zipimporter' object has no attribute 'exec_module' #1301

Closed Alexey-T closed 2 years ago

Alexey-T commented 2 years ago

When used inside CudaText plugin on Windows, we got

Python 3.8.13
Loading project: F:\django-tutorial\hello1\django_hello1.cuda-proj
Tab Icons: using theme vscode_material_24x24
LSP: starting server - Markdown; root: F:\django-tutorial\hello1
Startup: 530ms, plugins: 410ms (auto_save 32ms, cmd_history 15ms, exttools 32ms, macros 15ms, lsp 157ms, project_man 141ms, differ 16ms)
Traceback (most recent call last):
  File "F:\MySSDPrograms\cudatext\py\cuda_markdown_preview\__init__.py", line 11, in <module>
    import markdown
  File "F:\MySSDPrograms\cudatext\py\cuda_markdown_preview\markdown\__init__.py", line 22, in <module>
    from .core import Markdown, markdown, markdownFromFile
  File "F:\MySSDPrograms\cudatext\py\cuda_markdown_preview\markdown\core.py", line 27, in <module>
    from .preprocessors import build_preprocessors
  File "F:\MySSDPrograms\cudatext\py\cuda_markdown_preview\markdown\preprocessors.py", line 29, in <module>
    from .htmlparser import HTMLExtractor
  File "F:\MySSDPrograms\cudatext\py\cuda_markdown_preview\markdown\htmlparser.py", line 31, in <module>
    spec.loader.exec_module(htmlparser)
AttributeError: 'zipimporter' object has no attribute 'exec_module'
ERROR: Exception in CudaText for cuda_markdown_preview.config_live: AttributeError: 'zipimporter' object has no attribute 'exec_module'

is it compat with Python 3.8 ? with 3.10? @veksha

Alexey-T commented 2 years ago

Like error on python 3.8, we have error (different) on python 3.10 !

err

facelessuser commented 2 years ago

The etree error is an issue with the gfm plugin. etree has been removed from markdown.util and is no longer needed. They should be using etree directly now.

As far as the main issue, I'm not exactly sure, but it may be related to https://github.com/Python-Markdown/markdown/issues/1298.

Alexey-T commented 2 years ago

@facelessuser So what fixed file must we use? I use the last release of Markdown from PYPI.org.

facelessuser commented 2 years ago

I'm not sure which issue you're question is directed at. GFM extension must fix their own issue and use the built-in etree.

The other issue I have not looked into much yet. I know the issue fails in the same area as the other issue is all I'm noting. The issue is not exactly the same, but may be related.

waylan commented 2 years ago

There are two separate issues being reported here. In the future, please file separate reports for each issue.

Regarding the issue with the GFM extension, @facelessuser is correct, the extension needs to be updated to work with the latest release of Python-Markdown as outlined in our release notes. I would suggest reaching out to the developers of that extension. There is no action for us to take on this issue.

The other issue does appear to be related to #1298. I am closing this as a duplicate. Please follow up there.