fix(compat): catch AttributeError since EntryPoints object has no get()#9167
Closed
MarkoM-dot wants to merge 4 commits intoencode:masterfrom
Closed
fix(compat): catch AttributeError since EntryPoints object has no get()#9167MarkoM-dot wants to merge 4 commits intoencode:masterfrom
MarkoM-dot wants to merge 4 commits intoencode:masterfrom
Conversation
rest_framework/compat.py
Outdated
| md_filter_add_syntax_highlight(md) | ||
| return md.convert(text) | ||
| except ImportError: | ||
| except (ImportError, AttributeError): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
you'll need to update the pin in
Contributor
Author
There was a problem hiding this comment.
check related issue for traceback, markdown is already set to 3.3
graingert-coef
suggested changes
Dec 5, 2023
graingert-coef
left a comment
There was a problem hiding this comment.
I think it's better to update the pin on markdown in the tests, rather than catch this AttributeError
graingert-coef
suggested changes
Dec 12, 2023
graingert-coef
left a comment
There was a problem hiding this comment.
can you update the title of this PR now it just updates flake8
Contributor
Author
|
closing this pr as it is no longer relevant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pyshouldn'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.