Skip to content
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

bugfix: user-agent python-requests #8394

Merged
merged 8 commits into from
Sep 11, 2023
4 changes: 4 additions & 0 deletions src/poetry/utils/authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

from cachecontrol import CacheControlAdapter
from cachecontrol.caches import FileCache
from requests_toolbelt import user_agent

from poetry.__version__ import __version__
from poetry.config.config import Config
from poetry.exceptions import PoetryException
from poetry.utils.constants import REQUESTS_TIMEOUT
Expand Down Expand Up @@ -134,9 +136,11 @@ def __init__(
self._get_repository_config_for_url
)
self._pool_size = pool_size
self.user_agent = user_agent("poetry", __version__)
radoering marked this conversation as resolved.
Show resolved Hide resolved

def create_session(self) -> requests.Session:
session = requests.Session()
session.headers["User-Agent"] = self.user_agent

if self._cache_control is None:
return session
Expand Down