Bug with httpx

Open
#2,405 5 comments 0 reactions 1 assignee View on GitHub

@NghiaTranUIT is already working on this.

Since Jul 6, 2025.

Assessment

This issue has not been assessed yet.

Description

✅ Done bug

Description

In some cases, I get the error:

self = <aiohttp.client.ClientSession object at 0x10e8255e0>, k = ()
kw = {'connector': <aiohttp.connector.TCPConnector object at 0x10f447590>, 'trust_env': False}

    @functools.wraps(_http_connection_init)
    def _new_http_connection_init(self, *k, **kw):
        # ask aiohttp to use proxy from the evn
>       _http_connection_init(self, trust_env=True, *k, **kw)
E       TypeError: aiohttp.client.ClientSession.__init__() got multiple values for keyword argument 'trust_env'

/Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Versions/A/Resources/overrides/python/aiohttp.py:14: TypeError

Steps to Reproduce

  1. Use the "Manual Setup" feature of Proxyman to setup a Terminal, and run a Python script, presumably where trust_env is already being passed deep inside some library I'm depending on

Current Behavior

Exception as above.

Expected Behavior

As a fix, maybe something like:
kw.setdefault("trust_env", True)
instead of passing trust_env=True in the monkey patch

Environment

  • App version: Proxyman 5.22.0
Dominant language
No language data
Stars
7k
Forks
237
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ProxymanApp/Proxyman

All issues in ProxymanApp/Proxyman

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.