stripe-samples / accept-a-payment

Learn how to accept a payment from customers around the world with a variety of payment methods.
MIT License
653 stars 498 forks source link

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

Open NicholasRasi opened 8 months ago

NicholasRasi commented 8 months ago

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

Additional context

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

hideokamoto-stripe commented 6 months ago

@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.