[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

pypi2deb [PATCH] Fix proxy issues



Hi, below is a patch for

 https://salsa.debian.org/python-team/tools/pypi2deb

pypi2deb did not work with proxy:

# export | grep proxy
declare -x http_proxy="http://127.0.0.1:3128";
declare -x https_proxy="http://127.0.0.1:3128";
# py2dsp doh-cli -v
D: py2dsp py2dsp:163: version: 4.20240727
D: py2dsp py2dsp:164: ['/usr/bin/py2dsp', 'doh-cli', '-v']
D: py2dsp py2dsp:44: args: Namespace(verbose=True, quiet=False, root='/root/result', clean=False, build=False, application=False, profile=None, github=None, pypi_search=None, distribution='UNRELEASED', revision='0~py2deb', message='converte0~py2deb', name='doh-cli') D: py2dsp pypi:153: fetching upstream tarball from https://files.pythonhosted.org/packages/f2/a3/f7d86662c06bc6f90b0cf12cc5a5a21fae0bd384e025a73db895bbf7ff3f/doh_cli-0.8.tar.gz
E: py2dsp py2dsp:173: Cannot connect to host files.pythonhosted.org:443

PATCH:

From bfbb103b59a87947cf17399647b223ec6c961847 Mon Sep 17 00:00:00 2001
From: Ermakov Alexander <ermakovav@altgtu.ru>
Date: Mon, 15 Sep 2025 17:22:14 +0700
Subject: [PATCH] Fix proxy issues

---
 pypi2deb/pypi.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pypi2deb/pypi.py b/pypi2deb/pypi.py
index b2b7aca..742ccf5 100644
--- a/pypi2deb/pypi.py
+++ b/pypi2deb/pypi.py
@@ -149,7 +149,7 @@ async def download(name, version=None, destdir='.'):
     if exists(fpath):
         return fname

-    async with aiohttp.ClientSession() as session:
+    async with aiohttp.ClientSession(trust_env=True) as session:
         log.debug(f"fetching upstream tarball from {release['url']}")
         response = await session.get(release['url'])
with open(fpath if ext == orig_ext else join(destdir, release['filename']), 'wb') as fp:
--
2.48.1


Reply to: