-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not support Python 3.9 #86
Comments
Not sure if this is still an issue for you but I created a fork with 3.9 support https://github.com/WillNye/terminal_markdown_viewer that I'll be actively maintaining as it is used in several other frameworks I use. It's worth noting python2 support was dropped because it is no longer maintained. To install pip3 install -U mdv3 |
Hi, |
For now, I get the following error while running my project's tests with Travis for Python 3.9 :
Does anybody get this error too ? |
Hi dhondta,
|
Hi @davidrihtarsic |
I totally agree with @dhondta. Applying a patch is not a solution. |
I don't mind incorporating any fixes @dhondta @davidrihtarsic. Could you give me an example that raises the exception when running mdv3? |
@WillNye OK, I figured out that a previous build failed because of |
Hey how is this going? Neither |
@TheLastGimbus if you toss me an example that raises the exception as well as the traceback you're seeing I can look into it |
~$ mdv
... some stuff up here
this is a Note
----
!!! question: You like this theme?
Styling Result
Traceback (most recent call last):
File "/home/matiii/.local/bin/mdv", line 8, in <module>
sys.exit(run())
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1657, in run
print(main(**kw) if PY3 else str(main(**kw)))
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1375, in main
the_html = MD.convert(md)
File "/home/matiii/.local/lib/python3.9/site-packages/markdown/core.py", line 268, in convert
newRoot = treeprocessor.run(root)
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1150, in run
formatter(doc, out)
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1145, in formatter
formatter(c, out, hir + 1, parent=el)
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 970, in formatter
t = html_parser.unescape(t)
AttributeError: 'HTMLParser' object has no attribute 'unescape' ~/my-project$ mdv README.md
Traceback (most recent call last):
File "/home/matiii/.local/bin/mdv", line 8, in <module>
sys.exit(run())
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1657, in run
print(main(**kw) if PY3 else str(main(**kw)))
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1375, in main
the_html = MD.convert(md)
File "/home/matiii/.local/lib/python3.9/site-packages/markdown/core.py", line 268, in convert
newRoot = treeprocessor.run(root)
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1150, in run
formatter(doc, out)
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1145, in formatter
formatter(c, out, hir + 1, parent=el)
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 970, in formatter
t = html_parser.unescape(t)
AttributeError: 'HTMLParser' object has no attribute 'unescape'
~$ mdv
... some stuff here
----
!!! question: You like this theme?
Styling Result
Traceback (most recent call last):
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 505, in style_ansi
lexer = get_lexer_by_name(lexer_alias(lang))
File "/home/matiii/.local/lib/python3.9/site-packages/pygments/lexers/__init__.py", line 118, in get_lexer_by_name
raise ClassNotFound('no lexer for alias %r found' % _alias)
pygments.util.ClassNotFound: no lexer for alias 'language-python' found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/matiii/.local/bin/mdv", line 8, in <module>
sys.exit(run())
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1616, in run
print(main(**kw))
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1365, in main
raw = tags.code(raw.strip(), from_fenced_block=1, lang=lang)
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 690, in code
s = style_ansi(raw_code, lang=lang)
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 507, in style_ansi
print(col(R, 'Lexer for %s not found' % lang))
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 555, in col
if _strt in s:
TypeError: argument of type 'int' is not iterable ~/my-project$ mdv README.md
Traceback (most recent call last):
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 505, in style_ansi
lexer = get_lexer_by_name(lexer_alias(lang))
File "/home/matiii/.local/lib/python3.9/site-packages/pygments/lexers/__init__.py", line 118, in get_lexer_by_name
raise ClassNotFound('no lexer for alias %r found' % _alias)
pygments.util.ClassNotFound: no lexer for alias 'language-bash' found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/matiii/.local/bin/mdv", line 8, in <module>
sys.exit(run())
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1616, in run
print(main(**kw))
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 1365, in main
raw = tags.code(raw.strip(), from_fenced_block=1, lang=lang)
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 690, in code
s = style_ansi(raw_code, lang=lang)
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 507, in style_ansi
print(col(R, 'Lexer for %s not found' % lang))
File "/home/matiii/.local/lib/python3.9/site-packages/mdv/markdownviewer.py", line 555, in col
if _strt in s:
TypeError: argument of type 'int' is not iterable |
@TheLastGimbus Thanks for sending this over! I'm able to reproduce the problem and it looks like it stems from an existing issue where numbers in the markdown were being cast to an int. There was also an issue where an exception wasn't being handled properly. I'm busy with work today but I'll try to get to it today or tomorrow. In the meantime, I know it's a PITA an I'm sorry to ask but is there any way you could make an issue for this here? I don't actually maintain the legacy mdv or the repo this issue is filed under an I wanted to start keeping track of everything within my fork. |
Does not support Python >=3.9, no releases since 2016. axiros/terminal_markdown_viewer#86
Does not support Python >=3.9, no releases since 2016. axiros/terminal_markdown_viewer#86
Does not support Python >=3.9, no releases since 2016. axiros/terminal_markdown_viewer#86
Does not support Python >=3.9, no releases since 2016. axiros/terminal_markdown_viewer#86
Does not support Python >=3.9, no releases since 2016. axiros/terminal_markdown_viewer#86
From https://docs.python.org/3.9/whatsnew/3.9.html#removed :
The text was updated successfully, but these errors were encountered: