You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/private/tmp/main.py", line 19, in<module>asyncio.run(main())
File "/Users/povilas/.pyenv/versions/3.10.1/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Users/povilas/.pyenv/versions/3.10.1/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
returnfuture.result()
File "/private/tmp/main.py", line 12, in main
ctx = await browser.new_context(proxy=proxy_settings, ignore_https_errors=True)
File "/private/tmp/pyenv/lib/python3.10/site-packages/playwright/async_api/_generated.py", line 11317, in new_context
await self._async(
File "/private/tmp/pyenv/lib/python3.10/site-packages/playwright/_impl/_browser.py", line 117, in new_context
channel = await self._channel.send("newContext", params)
File "/private/tmp/pyenv/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 39, in send
return await self.inner_send(method, params, False)
File "/private/tmp/pyenv/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 63, in inner_send
result = next(iter(done)).result()
playwright._impl._api_types.Error: proxy.username: expected string, got object
I reproduced the error as expected when declaring proxy_settings as:
proxy_settings=ProxySettings(
server="http://localhost:8080", username=None, password=None
)
# results in a dict with these items:# dict_items([('server', 'http://localhost:8080'), ('username', None), ('password', None)])
Note, that another workaround is:
proxy_settings=ProxySettings(
server="http://localhost:8080"
)
# results in a dict with these items:# dict_items([('server', 'http://localhost:8080')])
So, username and password are implicitly optional, but if you explicitly declare them as None things break (which is an issue).
Context:
Code Snippet
Describe the bug
ProxySettings
declaration isNone
is not allowed forusername
andpassword
. This, however, works:The text was updated successfully, but these errors were encountered: