-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Disabling direct access to environment variables by telegram.HTTPXRequest
#4424
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
Comments
This issue has been automatically closed due to inactivity. Feel free to comment in order to reopen or ask again in our Telegram support group at https://t.me/pythontelegrambotgroup. |
Hi sorry for seemingly not answering, this issue sparked a bigger internal discussion around httpx args. We came to the decision to make a kwargs argument which allows to pass arbitrary arguments, we just didn't come around implementing it yet. |
telegram.HTTPXRequest
Issue I am facing
So httpx reads important options from environment variables (SSL settings, HTTP proxying). This is default behavior that can be disabled by passing
trust_env=False
when instantiatinghttpx.Client
.telegram.request.HTTPXRequest
(that manageshttpx.Client
) doesn't do that and doesn't expose a way to do that.I considered writing custom implementation of
telegram.request.BaseRequest
, replicatingHTTPXRequest
's interface. That's not ideal because it is not possible to implement the same interface without using undocumented/poorly documented features of httpx (whichHTTPXRequest
uses, specifically to passsocket_options
and some other options).I don't really understand how this is supposed to be handled without making an implementation inferior, so this issue is marked as question.
Traceback to the issue
No response
Related part of your code
No response
Operating System
Windows 10
Version of Python, python-telegram-bot & dependencies
The text was updated successfully, but these errors were encountered: