Skip to content

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

@jhgg

Description

@jhgg

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 :\

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions