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

Flask v2.2.0 changes some keyword argument #64

Open
jnguiot opened this issue Sep 24, 2022 · 0 comments
Open

Flask v2.2.0 changes some keyword argument #64

jnguiot opened this issue Sep 24, 2022 · 0 comments

Comments

@jnguiot
Copy link

jnguiot commented Sep 24, 2022

Initial conditions:

  • Flask-Images==3.0.2
  • Flask==2.2.2

Reproduction step

Use the imgresizer on a valid image. EG:

http://localhost:5000/imgsizer/test.jpg?h=480&m=crop&v=Yy8dVw&w=640&s=xxxxxx

Observed Behavior

The URL returns a 500 error.
Exception is:

2022-09-24 17:19:29,310 ERROR werkzeug Thread-310 : Error on request:
Traceback (most recent call last):
  File ".\.env\lib\site-packages\werkzeug\serving.py", line 335, in run_wsgi
    execute(self.server.app)
  File ".\.env\lib\site-packages\werkzeug\serving.py", line 322, in execute
    application_iter = app(environ, start_response)
  File ".\collectives\.env\lib\site-packages\flask\app.py", line 2548, in __call__
    return self.wsgi_app(environ, start_response)
  File ".\collectives\__init__.py", line 40, in __call__
    return self.app(environ, start_response)
  File ".\.env\lib\site-packages\flask\app.py", line 2528, in wsgi_app
    response = self.handle_exception(e)
  File ".\.env\lib\site-packages\flask\app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File ".\.env\lib\site-packages\flask\app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File ".\.env\lib\site-packages\flask\app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File ".\.env\lib\site-packages\flask\app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File ".\.env\lib\site-packages\flask_images\core.py", line 432, in handle_request
    return send_file(cache_path, mimetype=mimetype, cache_timeout=cache_timeout)
TypeError: send_file() got an unexpected keyword argument 'cache_timeout' datefmt=

Expected behavior:

Image should be downloadable without a 500 error.

First analysis

Flask has updated their send_file function by deprecating some key word argument. See https://github.com/pallets/flask/blob/73b9bacbf7e7440e5a8a65e61fecfe3d0ce75579/CHANGES.rst#version-220 . Code update from flask_image is required.

jnguiot added a commit to Club-Alpin-Annecy/Flask-Images that referenced this issue Sep 24, 2022
jnguiot added a commit to Club-Alpin-Annecy/Flask-Images that referenced this issue Sep 24, 2022
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

No branches or pull requests

1 participant