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

fix(compat): catch AttributeError since EntryPoints object has no get() #9167

Conversation

MarkoM-dot
Copy link
Contributor

Note: Before submitting this pull request, please review our contributing guidelines.

Description

Circumvents AttributeError: 'EntryPoints' object has no attribute 'get' so that you can run tests with python3.12 and that your ci can run tests. Markdown is optional and not necessary so exception handling in compat.py shouldn't be a problem.

Moreover, flake8 will also fail with the same error unless updated to 5.0.0.

This pull request is related to #9157.

@auvipy auvipy self-requested a review November 27, 2023 06:26
@@ -82,7 +82,7 @@ def apply_markdown(text):
)
md_filter_add_syntax_highlight(md)
return md.convert(text)
except ImportError:
except (ImportError, AttributeError):
Copy link

@graingert-coef graingert-coef Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the traceback you get that raises AttributeError? markdown has support for 3.12 and doesn't call entry_points(...).get(...)

https://github.com/Python-Markdown/markdown/blob/cef5afeb959d11e1ad5566fefa1f9a71136c1050/markdown/util.py#L110

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll need to update the pin in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check related issue for traceback, markdown is already set to 3.3

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

being handled here #9181

Copy link

@graingert-coef graingert-coef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to update the pin on markdown in the tests, rather than catch this AttributeError

Copy link

@graingert-coef graingert-coef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update the title of this PR now it just updates flake8

@MarkoM-dot
Copy link
Contributor Author

MarkoM-dot commented Dec 13, 2023

closing this pr as it is no longer relevant

@MarkoM-dot MarkoM-dot closed this Dec 13, 2023
@MarkoM-dot MarkoM-dot deleted the markdown-compatibility-attribute-error branch December 13, 2023 15:14
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

Successfully merging this pull request may close these issues.

3 participants