stripe-samples/accept-a-payment

Python server ImportError: cannot import name 'url_quote' from 'werkzeug.urls

Opened this issue · 1 comments

Bug report

Describe the bug

Error with Python server.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. stripe samples create accept-a-payment
  2. select html as client
  3. select python as server
  4. start the server
  5. error: ImportError: cannot import name 'url_quote' from 'werkzeug.urls'

Expected behavior

The server starts successfully.

System information

  • OS: Linux
  • Server environment: Python

Additional context

Adding a fixed Werkzeug version to the requirements.txt fixes the problem (Werkzeug==2.2.2)

@NicholasRasi
Thank you for the report. And I'm sorry for the late reply.
I cloned accept-a-payment/payment-element/server/python locally and tried it. The reported error did not occur. The issue may have been resolved when I updated Flask to version 3.0.2 using Dependabot.

Please try downloading the new source code and see if the problem is resolved. If you are still encountering the error, please try updating the Werkzeug version to one that is compatible with Flask 3.0.2 or later and see if that resolves the issue.

Thank you.