Comment 1 for bug 538937

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 538937] [NEW] Can't use bzrlib inside a django app

On Mon, 2010-03-15 at 06:27 +0000, Ian Clatworthy wrote:
> Public bug reported:
>
> Importing anything inside bzrlib ends up implicitly calling
> osutils.register_sigwinch() which breaks Django. Here's the end of the
> exception:
> ...File "/usr/lib/python2.6/dist-packages/bzrlib/osutils.py" in <module>
> 1446. signal.signal(signal.SIGWINCH, _terminal_size_changed)
>
> Exception Type: ValueError at /bzr-alldocs_/
> Exception Value: signal only works in main thread
>
> This is rather bad.

They should be able to 'work around' this trivially by importing
bzrlib.osutils in their main thread. Its a bit of a python bug that you
can't use signal from any thread, really.

That said, I think this has changed in trunk anyway, so that you have to
create a CLI UI for it to hook now.

-Rob