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 werkzeug 2.1.0 import & dev tools error html rendering. #1995

Merged
merged 3 commits into from
Mar 29, 2022

Conversation

T4rk1n
Copy link
Contributor

@T4rk1n T4rk1n commented Mar 29, 2022

optionals

  • I have added entry in the CHANGELOG.md

@T4rk1n T4rk1n requested a review from alexcjohnson as a code owner March 29, 2022 16:21
@T4rk1n T4rk1n force-pushed the 1992-fix-debugger branch from 2e5b21c to 877aaa9 Compare March 29, 2022 16:40
@alexcjohnson
Copy link
Collaborator

This looks good, and I've verified it works with both previous and new werkzeug versions. Given that this became necessary though, I'm a little uneasy depending on ANYTHING inside werkzeug submodules, because I don't see the things we care about documented so they clearly would feel free to change these whenever they see fit.

So I wonder if we could minimize the chance of future problems... first, gen_salt could be inlined easily:

def gen_salt(chars):
    return "".join(secrets.choice(string.ascii_letters + string.digits) for _ in range(chars))

Second, as nice as tbtools HTML output is, can we have a second fallback in case we don't find either of these (or perhaps in case we don't even find the tbtools module), that just uses traceback.format_exc() or something?

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

💃 Excellent. This should prevent breakage from any sort of future changes they might make.

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.

ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools'
2 participants