Skip to content

HTTPError doesn't support http.client constants. #1646

Description

@coady
  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository

  • Do you want to request a feature or report a bug?
    bug

  • What is the current behavior?
    http.client constants aren't accepted as valid input to HTTPError.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a screenshots and logs of the problem.

In []: cherrypy.HTTPError(http.client.NOT_FOUND)
...
Out []: HTTPError: (500, "Illegal response status from server ('HTTPStatus.NOT_FOUND' is non-numeric).")
  • What is the expected behavior?
    The same as with any int.

  • What is the motivation / use case for changing the behavior?
    It's effectively a Python 3 regression, since Python 2 httplib constants work, and an IntEnum is a valid int.

  • Please tell us about your environment:

  • Cheroot version: X.X.X
  • CherryPy version: 11.X.X
  • Python version: 3.6.X
  • OS: XXX
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, e.g. stackoverflow, gitter, etc.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions