[Python-modules-team] Bug#748903: python-tornado: FTBFS on hurd-i386

Samuel Thibault sthibault at debian.org
Thu May 22 08:13:29 UTC 2014


Svante Signell, le Thu 22 May 2014 10:02:55 +0200, a écrit :
> > > --- a/tornado_netutil.py	2014-01-09 03:57:56.000000000 +0100
> > > +++ b/tornado/netutil.py	2014-05-21 17:38:42.000000000 +0200
> > > @@ -119,7 +120,8 @@
> > >          """
> > >          sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
> > >          set_close_exec(sock.fileno())
> > > -        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
> > > +        if sys.platform != 'gnu0':
> > > +            sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
> > 
> > I would even just drop it completely for all systems: I don't see what
> > SO_REUSEADDR can mean for an AF_UNIX socket.
> 
> Then you should discuss with upstream. BTW: Other packages do the same
> kind of tests, I've seen this before.

That does not necessarily mean that it's a good idea.  Putting system
tests is a bad habit, it makes the code less readable, and most often
than not, brings nasty surprises later.  We should really rather wonder
what is actually correct.

> > > --- a/tornado/iostream.py	2014-01-04 17:51:39.000000000 +0100
> > > +++ b/tornado/iostream.py	2014-05-21 18:42:37.000000000 +0200
> > > @@ -687,9 +687,12 @@
> > >          self.socket = None
> > >  
> > >      def get_fd_error(self):
> > > -        errno = self.socket.getsockopt(socket.SOL_SOCKET,
> > > -                                       socket.SO_ERROR)
> > > -        return socket.error(errno, os.strerror(errno))
> > > +        if sys.platform != 'gnu0':
> > > +            errno = self.socket.getsockopt(socket.SOL_SOCKET,
> > > +                                           socket.SO_ERROR)
> > > +            return socket.error(errno, os.strerror(errno))
> > > +        else:
> > > +            return None
> > 
> > I would rather just catch the ENOSYS error, and return None in that
> > case.  Again, the idea is that I don't see what SO_ERROR could actually
> > report for AF_UNIX sockets.
> 
> Well, the test fails if ENOSYS is returned, I can try to fix that but
> this is probably an upstream issue again :(

It sure is an upstream issue, yes.

Here it is precisely an example where we really do *not* want to stuff
a system test: get_fd_error may be applied not only on a Unix socket
(where GNU/Hurd will return ENOSYS indeed), but also on a TCP/IP socket,
where GNU/Hurd will behave as expected, and python-tornado *wants*
this to work, to be able to cope with socket errors etc.  Putting a
system test here would cripple the software, and it will very probably
go unnoticed for many years. At best some people may notice that it
behaves badly on GNU/Hurd, and would blame GNU/Hurd for that, not
python-tornado, while it's actually python-tornado which will have been
crippled, and where the fix will be needed.  We really don't want that.

And no, I don't have time to discuss with upstream myself. If I had, I
would have submitted the bug report myself. It's really up to you to
submit proper patches. I have time to review your patches to make sure
they are proper, I don't have time to fix them and discuss with upstream
myself.

Samuel



More information about the Python-modules-team mailing list