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 · 2 comments

Comments

Projects
None yet
3 participants
@jhgg
Copy link

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

This comment has been minimized.

Copy link

commented Mar 21, 2019

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

This comment has been minimized.

Copy link
Member

commented Mar 21, 2019

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

@davidism davidism closed this Mar 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.