8000 Disabling direct access to environment variables by `telegram.HTTPXRequest` · Issue #4424 · python-telegram-bot/python-telegram-bot · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
asrelo opened this issue Aug 10, 2024 · 3 comments · Fixed by #4451
Closed

Disabling direct access to environment variables by telegram.HTTPXRequest #4424

asrelo opened this issue Aug 10, 2024 · 3 comments · Fixed by #4451

Comments

@asrelo
Copy link
asrelo commented Aug 10, 2024

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 instantiating httpx.Client.

telegram.request.HTTPXRequest (that manages httpx.Client) doesn't do that and doesn't expose a way to do that.

I considered writing custom implementation of telegram.request.BaseRequest, replicating HTTPXRequest's interface. That's not ideal because it is not possible to implement the same interface without using undocumented/poorly documented features of httpx (which HTTPXRequest uses, specifically to pass socket_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

python-telegram-bot 21.4
Bot API 7.7
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
@github-actions github-actions bot added the 📋 stale work status: stale label Aug 15, 2024
Copy link

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.

8000

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2024
@Poolitzer Poolitzer reopened this Aug 17, 2024
@Poolitzer
Copy link
Member

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.

@Poolitzer Poolitzer removed the 📋 stale work status: stale label Aug 17, 2024
@harshil21 harshil21 changed the title [QUESTION] Disabling direct access to environment variables by telegram.request.HTTPXRequest Disabling direct access to environment variables by telegram.HTTPXRequest Aug 17, 2024
@Bibo-Joshi
Copy link
Member

FYI: I openend #4451. @asrelo you're welcome to install from that branch to check if you can address your issue with that.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
0