[packagekit] Python fork() question

Richard Hughes hughsient at gmail.com
Tue Mar 4 04:54:10 PST 2008


On Tue, 2008-03-04 at 13:05 +0100, Sebastian Heinlein wrote:
> It seems that forking is not well supported by dbus:
> 
> http://lists.freedesktop.org/archives/dbus/2007-April/007508.html

Well, we don't actually need to keep the connection across the fork if I
understand things correctly.

> > b) I've heard that python's threading implementation leaves a lot to be
> > desired.
> 
> The c interpreter of python cannot use native threads. But since we
> don't rely on performance it should be ok.

Sure. I'm thinking threading might be a better plan than forking right
now.

> I attached a patch which should make the code clearer.

That code doesn't actually fork for me... and I also get:

Error: internal-error : Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/dbus/service.py", line 655, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.5/site-packages/packagekit/daemonBackend.py", line 471, in GetUpdates
    self.fork(self.doGetUpdates(filters))
  File "/usr/lib/python2.5/site-packages/packagekit/daemonBackend.py", line 124, in fork
    sys.exit(args[0](*args[1:], **kwargs))
TypeError: 'NoneType' object is not callable

Richard.





More information about the PackageKit mailing list