GNOME Bugzilla – Bug 684265
crash in SoupServer if interface property is not resolved
Last modified: 2014-05-02 13:33:59 UTC
Executing this source code file in python2.7 crash. from gi.repository import Soup class HTTPServer(Soup.Server): def __init__(self, address='127.0.0.1', port=8082): interface = Soup.Address.new(address, port) Soup.Server.__init__(self, port = port, interface = interface) HTTPServer() I just play a bit with Soup.Server trying to bind a custom address (localhost) as interface. The interface property http://developer.gnome.org/libsoup/stable/SoupServer.html#SoupServer--interface seems to be readable/writable.
you need to do interface.resolve_sync(None) before passing it to Soup.Server.__init__() This isn't technically a bug, but there's no good reason for it to force you to do that, so I'll fix this at some point. (We're in hard code freeze right now though.)
Thanks Dan, Doing interface.resolve_sync(None) avoid the crash perfectly. Good to know that you can fixed in the future. I will wait for the fix when the hard code freeze ends. Regards
SoupServer:interface is now deprecated in git master; there is a new API that involves creating the server first and then making calls to the soup_server_listen*() family of functions to set up the listeners.