[Bug 268169] www/py-requests: Handle space-separated values in NO_PROXY

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 05 Dec 2022 10:28:29 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268169

            Bug ID: 268169
           Summary: www/py-requests: Handle space-separated values in
                    NO_PROXY
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: sunpoet@FreeBSD.org
          Reporter: michael.osipov@siemens.com
             Flags: maintainer-feedback?(sunpoet@FreeBSD.org)
          Assignee: sunpoet@FreeBSD.org

NO_PROXY is unfortunately not standardized many applications and libs do
support whitespace- and comma-separated env var value. Unfortunately, due to PR
236204 one cannot use commas. Therefore, I have created a PR upstream, after a
long-running discussion they rejected my PR for no profound reason. To still
solve this problem on FreeBSD providing my patch to downstream.

withouth the patch:
=======
$ echo $NO_PROXY
localhost .siemens.net .siemens.com .siemens.de
osipovmi@deblndw011x:~/var/Projekte/lda-docgen/latex-system/templates (master
=)
$ .gitlab-ci/validate-templates.py -S backend-dev -J 8 LaTeXSample/1
2022-12-05 11:26:16,099 [MainThread] INFO validate-templates.py: Validating
template 'LaTeXSample/1'
...
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line
700, in urlopen
    self._prepare_proxy(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line
996, in _prepare_proxy
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line
369, in connect
    self._tunnel()
  File "/usr/local/lib/python3.7/http/client.py", line 931, in _tunnel
    message.strip()))
OSError: Tunnel connection failed: 502 Bad Gateway

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 499,
in send
    timeout=timeout,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line
788, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line
592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError:
HTTPSConnectionPool(host='....ad001.siemens.net', port=443): Max retries
exceeded with url: /backend-dev/api/documents (Caused by ProxyError('Cannot
connect to proxy.', OSError('Tunnel connection failed: 502 Bad Gateway')))
=======

With the patch all works.

-- 
You are receiving this mail because:
You are the assignee for the bug.