need some help with unexpected signal exception when using inputfrom a thread (Pypy 1.9.0 on osx/lin

Discussion in 'Python' started by Irmen de Jong, Dec 15, 2012.

  1. Hi.
    Using Pypy 1.9.0. Importing readline. Using a background thread to get input() from
    stdin. It then crashes with:

    File "/usr/local/Cellar/pypy/1.9/lib_pypy/pyrepl/unix_console.py", line 400, in restore
    signal.signal(signal.SIGWINCH, self.old_sigwinch)
    ValueError: signal() must be called from the main thread

    Anyone seen this before? What's going on?
    When I don't import readline, or do the input() from within the main thread, the problem
    disappears.

    (I tried to reproduce it in a small test scenario but unfortunately have not been able
    to do so yet. Haven't figured out yet what the additional factors are that trigger this
    problem. A simple import readline and input() from a new thread doesn't seem to trigger
    it, unfortunately)


    Regards
    Irmen de Jong
    Irmen de Jong, Dec 15, 2012
    #1
    1. Advertising

  2. Irmen de Jong <> writes:

    > Using Pypy 1.9.0. Importing readline. Using a background thread to get input() from
    > stdin. It then crashes with:
    >
    > File "/usr/local/Cellar/pypy/1.9/lib_pypy/pyrepl/unix_console.py", line 400, in restore
    > signal.signal(signal.SIGWINCH, self.old_sigwinch)
    > ValueError: signal() must be called from the main thread
    >
    > Anyone seen this before? What's going on?


    Apparently, "input" is not apt to be called from a "background thread".

    I have no idea why "signal" should only be callable from the main thread.
    I do not think this makes much sense. Speak with the "Pypy" developers
    about this.
    Dieter Maurer, Dec 16, 2012
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christian  Decker

    Portable libraries for Mac/Win/Lin?

    Christian Decker, Oct 19, 2004, in forum: C++
    Replies:
    3
    Views:
    323
    Mike Wahler
    Oct 19, 2004
  2. Jack Orenstein

    threading.Thread vs. signal.signal

    Jack Orenstein, Sep 18, 2005, in forum: Python
    Replies:
    0
    Views:
    457
    Jack Orenstein
    Sep 18, 2005
  3. Replies:
    6
    Views:
    1,098
  4. Michael Sgier

    1. Porting win to lin

    Michael Sgier, Jul 10, 2005, in forum: C++
    Replies:
    2
    Views:
    362
    Stuart MacMartin
    Jul 10, 2005
  5. Michael Sgier

    porting win to lin by newbie

    Michael Sgier, Jul 21, 2005, in forum: C++
    Replies:
    1
    Views:
    363
    Alan Johnson
    Jul 21, 2005
Loading...

Share This Page