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

crash under Win64: no attribute 'exec_module' #1286

Closed Alexey-T closed 2 years ago

Alexey-T commented 2 years ago

CudaText plugin, code is here https://github.com/CudaText-addons/cuda_markdown_preview

crashes on Win64, https://github.com/Alexey-T/CudaText/issues/4293

ccc

Alexey-T commented 2 years ago

on Win64 CudaText ships with Python 3.8 (old was 3.6).

veksha commented 2 years ago
  1. https://bugs.python.org/issue42131 (i don't know if it is related)

  2. also found the following solution: "downgrade markdown module"

    pip install markdown==3.2.2

    (didn't try it)

  3. some opened issue on Markdown bug-tracker https://github.com/Python-Markdown/markdown/issues/1132

Alexey-T commented 2 years ago

I don't like 'downgrade' way, better I wait until it's fixed.

waylan commented 2 years ago

This is a duplicate of #1132.

waylan commented 2 years ago

As I note in #1132, this has been fixed in Python 3.10. Upgrading should fix the issue.

Alexey-T commented 2 years ago

users of CudaText have Python 3.8 preinstalled.

waylan commented 2 years ago

Unfortunately, I am not aware of any workarounds. The issue is in Python's zipimport library, not with our code. If CudaText is using zipimport then they need to support Python 3.10 (or backport zipimport from Python 3.10) to have a properly working implementation.

Alexey-T commented 2 years ago

after user upgraded to Python 3.10 DLLs, he sees new error:

er

@veksha

also found the following solution: "downgrade markdown module" pip install markdown==3.2.2

do you know where do get 3.2.2 version? I cannot find it on https://pypi.org/project/Markdown/#files

facelessuser commented 2 years ago

Yup the trace explains that the gfm extension (which is not our code) is trying to access markdown.util.etree which is no longer provided. So gfm will have to update its code to not access markdown.util.etree and instead use:

import xml.etree.ElementTree as etree