OS type and version: Podman container on windows 10 running the python image
Python version: 3.10.13
pip version: 23.0.1
google-auth-oauthlib version: 1.2.0
Steps to reproduce
Run the code example in an environment without browser access (eg. docker container)
Code example
flow = InstalledAppFlow.from_client_secrets_file('credentials.json', SCOPES)
try:
creds = flow.run_local_server(port=8080)
except:
## Adding sleep here doesn't seem help with release the port either
creds = flow.run_local_server(port=8080, open_browser=False)
Stack trace
Traceback (most recent call last):
File "example.py", line 4, in test
creds = flow.run_local_server(port=8080)
File "/usr/local/lib/python3.10/site-packages/google_auth_oauthlib/flow.py", line 444, in run_local_server
webbrowser.get(browser).open(auth_url, new=1, autoraise=True)
File "/usr/local/lib/python3.10/webbrowser.py", line 65, in get
raise Error("could not locate runnable browser")
webbrowser.Error: could not locate runnable browser
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "example.py", line 7, in test
creds = flow.run_local_server(port=8080, open_browser=False)
File "/usr/local/lib/python3.10/site-packages/google_auth_oauthlib/flow.py", line 432, in run_local_server
local_server = wsgiref.simple_server.make_server(
File "/usr/local/lib/python3.10/wsgiref/simple_server.py", line 154, in make_server
server = server_class((host, port), handler_class)
File "/usr/local/lib/python3.10/socketserver.py", line 452, in __init__
self.server_bind()
File "/usr/local/lib/python3.10/wsgiref/simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
File "/usr/local/lib/python3.10/http/server.py", line 137, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/local/lib/python3.10/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
Making sure to follow these steps will guarantee the quickest resolution possible.
Environment details
google-auth-oauthlib
version: 1.2.0Steps to reproduce
Code example
Stack trace
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!