Bug 268169 - www/py-requests: Handle space-separated values in NO_PROXY
Summary: www/py-requests: Handle space-separated values in NO_PROXY
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Po-Chuan Hsieh
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2022-12-05 10:28 UTC by Michael Osipov
Modified: 2023-01-02 15:24 UTC (History)
3 users (show)

See Also:
sunpoet: maintainer-feedback-


Attachments
Git-formatted patch (2.10 KB, patch)
2022-12-05 10:33 UTC, Michael Osipov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Osipov 2022-12-05 10:28:29 UTC
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.
Comment 2 Michael Osipov 2022-12-05 10:33:24 UTC
Created attachment 238536 [details]
Git-formatted patch
Comment 3 Michael Osipov 2022-12-05 10:35:52 UTC
Adding to have koobs@'s opinion.
Comment 4 Po-Chuan Hsieh freebsd_committer freebsd_triage 2023-01-01 19:15:16 UTC
I'm not going to commit this. Please make it accepted by upstream.
Comment 5 Michael Osipov 2023-01-02 08:47:43 UTC
(In reply to Po-Chuan Hsieh from comment #4)

I tried (https://github.com/psf/requests/pull/5465), they closed the PR w/o reasonable explanation and even locked the discussion. What should I do? This is a serious problem for users behind a proxy.
Comment 6 Michael Osipov 2023-01-02 08:53:46 UTC
I can try, of course, create a new PR...
Comment 7 Michael Osipov 2023-01-02 15:24:42 UTC
The alternative is that Bug 236204 is addressed in 13 and 14. The merge window for 12 has been missed. That would be fine for me also.

WDYT?