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

Vendored version of hyper is not compatible with Python 3.10 #31315

Closed
mitchhentges opened this issue Oct 19, 2021 · 5 comments · Fixed by #33113
Closed

Vendored version of hyper is not compatible with Python 3.10 #31315

mitchhentges opened this issue Oct 19, 2021 · 5 comments · Fixed by #33113
Labels

Comments

@mitchhentges
Copy link
Contributor

A bunch of classes were moved from collections to collections.abc. More details about that are documented here. In Python 3, the "compatibility" re-exports in collections were removed, so obsolete imports are now causing errors.

The current vendored hyper version isn't compatible with the new class location, as visible here, for example.

Note that this isn't fixed upstream, and the project is no longer maintained.

Note: I'm not personally seeing errors from this, but I'm not running WPT locally. Perhaps hyper isn't used in a way where it runs the obsolete code, I'm not sure (though I'd be surprised if that was the case).

@gsnedders
Copy link
Member

see also #28784 about it being unmaintained; one option is that we just fork it and fix compatibility with Python 3.10

@foolip foolip added the infra label Nov 17, 2021
@jgraham
Copy link
Contributor

jgraham commented Nov 17, 2021

We only use hyper itself in unittests; I think we could trivially replace it with httpx. We use h2 and hyperframe on the server side, but I believe those are both still supported.

@foolip
Copy link
Member

foolip commented Mar 8, 2022

I sent #33112 to fix this.

foolip added a commit that referenced this issue Mar 8, 2022
This library is no longer maintained.

Fixes #31315.
@foolip
Copy link
Member

foolip commented Mar 8, 2022

#33113 is an alternative, if that can be made to work.

@gsnedders
Copy link
Member

#31363 is also kinda related here, because it makes it easier to apply patches to what we're importing, but it's probably more worthwhile replacing hyper.

foolip added a commit that referenced this issue Mar 18, 2022
hyper is no longer maintained, and doesn't work with Python 3.10.

The vendored hyper is removed entirely, and replaced by httpx installed
using pip.

Tests are updated, mostly in trivial ways. A few cases are interesting:

 - When httpx is used to POST, `handle_data` ends up called two times
   instead of once, first with the data, and then with an empty byte
   string. Whether this is an httpx bug or not, test_h2_data.py and
   test_h2_headers_data.py are adapted to deal with this, and changed to
   case-swap the input instead so that no buffering is needed.

 - `test_encode` previously failed an assert in the handler, but the
   response wasn't checked at all, so this wasn't noticed.

 - `test_push` is dropped since it can't be tested using httpx.

 - `test_raw_header_frame_invalid` is dropped since it ends up testing
   the error handling of the client, and httpx doesn't treat this input
   as an error. A better test would just check what bytes were sent over
   the wire, but don't bother, it's more work than seems justified.

 - `test_http_version` is added to make sure these tests keep using
   HTTP/2 even if httpx behavior changes in the future.

Fixes #28784.
Fixes #31315.
jgraham pushed a commit that referenced this issue Mar 22, 2022
hyper is no longer maintained, and doesn't work with Python 3.10.

The vendored hyper is removed entirely, and replaced by httpx installed
using pip.

Tests are updated, mostly in trivial ways. A few cases are interesting:

 - When httpx is used to POST, `handle_data` ends up called two times
   instead of once, first with the data, and then with an empty byte
   string. Whether this is an httpx bug or not, test_h2_data.py and
   test_h2_headers_data.py are adapted to deal with this, and changed to
   case-swap the input instead so that no buffering is needed.

 - `test_encode` previously failed an assert in the handler, but the
   response wasn't checked at all, so this wasn't noticed.

 - `test_push` is dropped since it can't be tested using httpx.

 - `test_raw_header_frame_invalid` is dropped since it ends up testing
   the error handling of the client, and httpx doesn't treat this input
   as an error. A better test would just check what bytes were sent over
   the wire, but don't bother, it's more work than seems justified.

 - `test_http_version` is added to make sure these tests keep using
   HTTP/2 even if httpx behavior changes in the future.

Fixes #28784.
Fixes #31315.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Mar 26, 2022
…hyper, a=testonly

Automatic update from web-platform-tests
Use httpx for wptserve tests instead of hyper

hyper is no longer maintained, and doesn't work with Python 3.10.

The vendored hyper is removed entirely, and replaced by httpx installed
using pip.

Tests are updated, mostly in trivial ways. A few cases are interesting:

 - When httpx is used to POST, `handle_data` ends up called two times
   instead of once, first with the data, and then with an empty byte
   string. Whether this is an httpx bug or not, test_h2_data.py and
   test_h2_headers_data.py are adapted to deal with this, and changed to
   case-swap the input instead so that no buffering is needed.

 - `test_encode` previously failed an assert in the handler, but the
   response wasn't checked at all, so this wasn't noticed.

 - `test_push` is dropped since it can't be tested using httpx.

 - `test_raw_header_frame_invalid` is dropped since it ends up testing
   the error handling of the client, and httpx doesn't treat this input
   as an error. A better test would just check what bytes were sent over
   the wire, but don't bother, it's more work than seems justified.

 - `test_http_version` is added to make sure these tests keep using
   HTTP/2 even if httpx behavior changes in the future.

Fixes web-platform-tests/wpt#28784.
Fixes web-platform-tests/wpt#31315.

--

wpt-commits: 05ae936451baacd34744c539ad34388617e12190
wpt-pr: 33113
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Mar 27, 2022
…hyper, a=testonly

Automatic update from web-platform-tests
Use httpx for wptserve tests instead of hyper

hyper is no longer maintained, and doesn't work with Python 3.10.

The vendored hyper is removed entirely, and replaced by httpx installed
using pip.

Tests are updated, mostly in trivial ways. A few cases are interesting:

 - When httpx is used to POST, `handle_data` ends up called two times
   instead of once, first with the data, and then with an empty byte
   string. Whether this is an httpx bug or not, test_h2_data.py and
   test_h2_headers_data.py are adapted to deal with this, and changed to
   case-swap the input instead so that no buffering is needed.

 - `test_encode` previously failed an assert in the handler, but the
   response wasn't checked at all, so this wasn't noticed.

 - `test_push` is dropped since it can't be tested using httpx.

 - `test_raw_header_frame_invalid` is dropped since it ends up testing
   the error handling of the client, and httpx doesn't treat this input
   as an error. A better test would just check what bytes were sent over
   the wire, but don't bother, it's more work than seems justified.

 - `test_http_version` is added to make sure these tests keep using
   HTTP/2 even if httpx behavior changes in the future.

Fixes web-platform-tests/wpt#28784.
Fixes web-platform-tests/wpt#31315.

--

wpt-commits: 05ae936451baacd34744c539ad34388617e12190
wpt-pr: 33113
aosmond pushed a commit to aosmond/gecko that referenced this issue Mar 28, 2022
…hyper, a=testonly

Automatic update from web-platform-tests
Use httpx for wptserve tests instead of hyper

hyper is no longer maintained, and doesn't work with Python 3.10.

The vendored hyper is removed entirely, and replaced by httpx installed
using pip.

Tests are updated, mostly in trivial ways. A few cases are interesting:

 - When httpx is used to POST, `handle_data` ends up called two times
   instead of once, first with the data, and then with an empty byte
   string. Whether this is an httpx bug or not, test_h2_data.py and
   test_h2_headers_data.py are adapted to deal with this, and changed to
   case-swap the input instead so that no buffering is needed.

 - `test_encode` previously failed an assert in the handler, but the
   response wasn't checked at all, so this wasn't noticed.

 - `test_push` is dropped since it can't be tested using httpx.

 - `test_raw_header_frame_invalid` is dropped since it ends up testing
   the error handling of the client, and httpx doesn't treat this input
   as an error. A better test would just check what bytes were sent over
   the wire, but don't bother, it's more work than seems justified.

 - `test_http_version` is added to make sure these tests keep using
   HTTP/2 even if httpx behavior changes in the future.

Fixes web-platform-tests/wpt#28784.
Fixes web-platform-tests/wpt#31315.

--

wpt-commits: 05ae936451baacd34744c539ad34388617e12190
wpt-pr: 33113
aosmond pushed a commit to aosmond/gecko that referenced this issue Mar 28, 2022
…hyper, a=testonly

Automatic update from web-platform-tests
Use httpx for wptserve tests instead of hyper

hyper is no longer maintained, and doesn't work with Python 3.10.

The vendored hyper is removed entirely, and replaced by httpx installed
using pip.

Tests are updated, mostly in trivial ways. A few cases are interesting:

 - When httpx is used to POST, `handle_data` ends up called two times
   instead of once, first with the data, and then with an empty byte
   string. Whether this is an httpx bug or not, test_h2_data.py and
   test_h2_headers_data.py are adapted to deal with this, and changed to
   case-swap the input instead so that no buffering is needed.

 - `test_encode` previously failed an assert in the handler, but the
   response wasn't checked at all, so this wasn't noticed.

 - `test_push` is dropped since it can't be tested using httpx.

 - `test_raw_header_frame_invalid` is dropped since it ends up testing
   the error handling of the client, and httpx doesn't treat this input
   as an error. A better test would just check what bytes were sent over
   the wire, but don't bother, it's more work than seems justified.

 - `test_http_version` is added to make sure these tests keep using
   HTTP/2 even if httpx behavior changes in the future.

Fixes web-platform-tests/wpt#28784.
Fixes web-platform-tests/wpt#31315.

--

wpt-commits: 05ae936451baacd34744c539ad34388617e12190
wpt-pr: 33113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants