bzrlig.branch and the signal module

John Szakmeister john at szakmeister.net
Sun Mar 21 11:01:31 GMT 2010


On Sun, Mar 21, 2010 at 6:39 AM, }--o <viktor.nagy at gmail.com> wrote:
[snip]
> signal.signal(signal.SIGWINCH, _terminal_size_changed)
>
> and a traceback is thrown:
>
>   File "/home/nagyv/workspace/CooSci/webapp/bzr/util.py", line 2, in
> <module>
>     from bzrlib import branch, bzrdir
>   File
> "/home/nagyv/virtualenv/coosci/lib/python2.5/site-packages/bzrlib/branch.py",
> line 52, in <module>
>     from bzrlib.lock import _RelockDebugMixin
>   File
> "/home/nagyv/virtualenv/coosci/lib/python2.5/site-packages/bzrlib/lock.py",
> line 42, in <module>
>     from bzrlib import (
>   File
> "/home/nagyv/virtualenv/coosci/lib/python2.5/site-packages/bzrlib/errors.py",
> line 20, in <module>
>     from bzrlib import (
>   File
> "/home/nagyv/virtualenv/coosci/lib/python2.5/site-packages/bzrlib/osutils.py",
> line 1446, in <module>
>     signal.signal(signal.SIGWINCH, _terminal_size_changed)
> ValueError: signal only works in main thread
>
> The import above worked with some old version of bazaar, but it would be
> nice to update the code for bazaar 2.1 at least. So, could someone help me
> in changing the code above so that is will run fine?

I believe this problem has been fixed in trunk, and, IIRC, was to be
back-ported to 2.1.  Basically, that line has been moved into some
code that only gets called when the command line client is
instantiated.

I think this bug was the one tracking the issue:
    <https://launchpad.net/bugs/521989>

And it looks like it landed on trunk in r5055.

HTH!

-John



More information about the bazaar mailing list