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

Change to Unauthorized's argument order breaks existing code #1483

Closed
jhgg opened this issue Mar 21, 2019 · 3 comments
Closed

Change to Unauthorized's argument order breaks existing code #1483

jhgg opened this issue Mar 21, 2019 · 3 comments
Milestone

Comments

@jhgg
Copy link

jhgg commented Mar 21, 2019

In this commit: https://github.com/pallets/werkzeug/pull/1319/files#diff-43a63db82587e91732eda181306d76c7R240

The constructor of Unauthorized used to take the description as the first argument, but now takes www_authenticate as the first argument. This breaks backwards compatibility with all existing callers of Unauthorized.

Would it be possible to change:

def __init__(self, www_authenticate=None, description=None):

to

def __init__(self, description=None, www_authenticate=None):

In 0.14.x, abort(401, 'some error description') now does a completely different thing in 0.15.0 - and that is a breaking change.

405 - MethodNotAllowed also shares this special case... but that's 11 years old at this point :\

@lparet-yseop
Copy link

Same issue here.
It is an important breaking change, I have to fix the Werkzeug version to 0.14.1 in my setup.py by waiting a fix
Thanks for your help

@davidism davidism added this to the 0.15.1 milestone Mar 21, 2019
@davidism
Copy link
Member

I guess I was trying to be consistent with 405, but yeah, it makes more sense to leave description first.

@davidism davidism changed the title 0.15.0 breaks changes Unauthorized's argument ordering: Change to Unauthorized's argument order breaks existing code Mar 21, 2019
@melon-ruet
Copy link

Got same issue at Werkzeug==1.0.1

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants