Public bug reported: In AptOfflineCoreLib.py there is a call to socket.setdefaulttimeout() which changes the default timeout from infinite to 30 seconds. Additionally the user has the option to provide a non-infinite timeout via a command line switch during 'apt-offline get' commands.
This changes the timeout for all sockets including those used within httplib (called from urllib2). Unfortunately httplib converts the socket to a file descriptor using socket.makefile() and the documentation for that function in Python2.7 states "The socket must be in blocking mode (it can not have a timeout)". The result, at least on FreeBSD10, is that the 'apt-offline get' function fails whenever the socket is not ready with data immediately. Changing the timeout value to something very large doesn't appear to help and I suspect there may be some implementation issue specific to FreeBSD which causes read/recv on sockets to return before the timeout. Setting the timeout to infinite ('None') resolves the issue and can be done directly in the urllib2.urlopen() function by providing an argument 'timeout=None' to enforce the timeout for just that connection. Regards, Duane. ** Affects: apt-offline (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1343159 Title: apt-offline get doesn't work on FreeBSD 10/Python 2.7.6 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/apt-offline/+bug/1343159/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs