[Debian-astro-maintainers] Bug#997469: dh-python doesn't allow local connections via urllib

Ole Streicher olebole at debian.org
Tue Oct 26 07:43:50 BST 2021


Control: reassign -1 dh-python 5.20211022.1
Control: retitle -1 dh-python doesn't allow local connections via urllib
Control: affects -1 src:gwcs

By Debian Policy (4.9), it is allowed to establish an loopback internet 
connection to a self-started service during build. This is used in some 
of my Python packages, namely gwcs (via the python3-asdf package) for 
roundtrip tests.

"Earlier" this worked well. However, in the last "sid" rebuild it turned 
out that the communication between dh-python and python's urllib doesn't 
make the "localhost" exception anymore. From the build log:

-----------------------8<--------------------------------------------
self = <http.client.HTTPConnection object at 0x7fd80aa7e970>
data = b'GET http://127.0.0.1:55011/test.asdf 
HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: 
127.0.0.1:55011\r\nUser-Agent: Python-urllib/3.9\r\nConnection: 
close\r\n\r\n'

     def send(self, data):
         """..."""

         if self.sock is None:
             if self.auto_open:
 >               self.connect()

/usr/lib/python3.9/http/client.py:974:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _

self = <http.client.HTTPConnection object at 0x7fd80aa7e970>

     def connect(self):
         """Connect to the host and port specified in __init__."""
 >       self.sock = self._create_connection(
             (self.host,self.port), self.timeout, self.source_address)

/usr/lib/python3.9/http/client.py:945:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _

address = ('127.0.0.1', 9), timeout = <object object at 0x7fd8104d2e10>
source_address = None
-----------------------8<--------------------------------------------

This shows that a connection to a loopback interface (here: 
127.0.0.1:55011) is now handled by the proxy, which is not how it should 
be. Connections to 127.0.0.1 should be passed directly.

Best regards

Ole



More information about the Debian-astro-maintainers mailing list