Skip to content
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

Failed in Python 3.12.3 #3

Open
mcdemarco opened this issue Apr 12, 2024 · 3 comments
Open

Failed in Python 3.12.3 #3

mcdemarco opened this issue Apr 12, 2024 · 3 comments

Comments

@mcdemarco
Copy link

I got an error running in python 3.12.3. I downgraded to python 3.6.15 and got a simple test file through.

 % python md_to_bgg.py test.md                                     
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:46: SyntaxWarning: invalid escape sequence '\('
  '\(https?://.*?boardgamegeek\.com[^)\s]*'
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:49: SyntaxWarning: invalid escape sequence '\S'
  '/(?P<link_type>\S+?)/(?P<object_ID>\d+)\S*?'
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:50: SyntaxWarning: invalid escape sequence '\)'
  '\)')
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:70: SyntaxWarning: invalid escape sequence '\('
  "!\("
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:71: SyntaxWarning: invalid escape sequence '\S'
  "https?://\S*?boardgamegeek.com\S*?"
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:72: SyntaxWarning: invalid escape sequence '\d'
  "/image/(?P<image_ID>\d+)\S*?"
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:73: SyntaxWarning: invalid escape sequence '\S'
  "(?: +(?P<size>\S+))?"
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:74: SyntaxWarning: invalid escape sequence '\)'
  "\)")
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:92: SyntaxWarning: invalid escape sequence '\('
  pattern = "!\((?P<image_URL>\S*?)\)"
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:107: SyntaxWarning: invalid escape sequence '\('
  "\("
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:109: SyntaxWarning: invalid escape sequence '\S'
  "https?://\S*?youtu\S*?"
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:110: SyntaxWarning: invalid escape sequence '\?'
  "/watch\?v=(?P<video_ID>\S+?)"
/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py:111: SyntaxWarning: invalid escape sequence '\)'
  "\)")
Traceback (most recent call last):
  File "/Users/mcd/[...]/markdown_to_BGG/md_to_bgg.py", line 279, in <module>
    parse_and_render = marko.Markdown(
                       ^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/marko/__init__.py", line 68, in __init__
    self.use(*extensions)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/marko/__init__.py", line 87, in use
    self._parser_mixins = extension.parser_mixins + self._parser_mixins
                          ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'BGGExtension' has no attribute 'parser_mixins'
mcd ~/[...]/markdown_to_BGG 10:25AM (git:main) % which python3                                                   
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3
mcd ~/[...]/markdown_to_BGG 10:25AM (git:main) % which marko                
/Users/mcd/.pyenv/shims/marko
mcd ~/[...]/markdown_to_BGG 10:25AM (git:main) % marko --version
1.2.2

The error above is for a downgraded marko that worked with python 3.6.15, but I got the same error with a current marko. (I think it was 2.0.2.) MacOS 12.7.3; there's no system python anymore but I installed the current python manually and with homebrew and got the same results.

@lebigot
Copy link
Owner

lebigot commented Apr 12, 2024

Python now forbids undefined escape sequences, indeed.

This should be quite easy to fix.

I'll have a look.

@lebigot
Copy link
Owner

lebigot commented Apr 13, 2024

I fixed the SyntaxWarnings, in the current GitHub version (a8307e4).

I haven't looked at the new parser_mixins missing attribute error in Marko yet. What "worked" with Marko 1.2.2 and Python 3.6.15: Marko itself or md_to_bgg? I'm trying to narrow down the problem.

@mcdemarco
Copy link
Author

I meant that md_to_bgg worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants