Skip to content

httputil: Clean up HTTPServerRequest uri and start_line #3637

@bdarnell

Description

@bdarnell

HTTPServerRequest has two redundant arguments, uri and start_line. If start_line is given, it takes precedence. All production code paths specify start_line, but some of tornado's test cases use uri only, and some third party test cases (jupyter_server) specify neither.

Prior to #3542, both were kind of optional (depending on what you did with the request object); since that PR it has been mandatory to specify one of them. This will make the upgrade to Tornado 6.6 mildly disruptive to at least jupyter_server.

  • Consider replacing the assertions added in Make uri and method attributes on HTTPServerRequest mandatory #3542 with deprecation warnings (and giving method/uri/version hard-coded defaults instead of None, to avoid supressing type warnings?). If not, give jupyter_server a heads up about start_line becoming mandatory.
  • In 6.6: Add deprecation warnings when method, uri, or version are given non-None values, or when start_line is None
  • In 6.7: Remove method, uri, version arguments, make other constructor arguments keyword-only, and make start_line mandatory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions