-
Notifications
You must be signed in to change notification settings - Fork 21
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
environ["SERVER_PORT"] could be "None" #8
Comments
Just noticed tests were changed in e2a7bfd... So should the line in |
https://www.python.org/dev/peps/pep-3333/#environ-variables In the WSGI standard, This is a problem with the old version of httpx you are using, not a2wsgi. Please upgrade the httpx version to the latest 0.16 and run the script again. |
Sorry, it is indeed not a bug on a2wsgi side. But I was actually using httpx 0.16.1:
And I could not find in which commit httpx fixed the problem you mentioned. Could you please kindly point it out? |
You can see this line https://github.com/encode/httpx/blob/0.16.1/httpx/_models.py#L121. The port should be automatically completed by another library. If httpx 0.16 does not work properly in your environment, please check the version of rfc3986. |
By the way, you can try the library version specified in poetry.lock. It should be able to pass all test cases. |
I'm sorry, I just tried running this script. But found the same error as you. Maybe it's that after upgrading httpx some time in the past, I never tried to run it again. This is a problem with httpx. I will submit a PR for httpx to fix this error. Thanks for your feedback. |
encode/httpx#1469 Done. |
Awesome! |
The benchmark appears to be broken in my test, which reports an ValueError caused by trying to convert "None" to int.
(Also reproduced in a cleanly installed Docker container. )
The error message:
After some investigation, I found out that the
port
property inhttpx.URL
changed its behavior in encode/httpx@c089480#diff-c9a78eb3b5f5c4fac4e5552165fbdd5320c7e3fadf9eedabcb5461393466c090L107-R110.So a simple fix might be adding conditional statements for
SERVER_PORT
andurl_scheme
.The text was updated successfully, but these errors were encountered: