-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
fix(compat): catch AttributeError since EntryPoints object has no get() #9167
Conversation
rest_framework/compat.py
Outdated
@@ -82,7 +82,7 @@ def apply_markdown(text): | |||
) | |||
md_filter_add_syntax_highlight(md) | |||
return md.convert(text) | |||
except ImportError: | |||
except (ImportError, AttributeError): |
There was a problem hiding this comment.
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(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
markdown==3.3 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
being handled here #9181
There was a problem hiding this 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
There was a problem hiding this 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
closing this pr as it is no longer relevant |
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 incompat.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.