tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Workaround for Suspended (tty output) in python?



    Date:        Wed, 3 Jan 2024 18:25:44 +0300
    From:        Valery Ushakov <uwe%stderr.spb.ru@localhost>
    Message-ID:  <ZZV8eMJsxjo2dMsO%snips.stderr.spb.ru@localhost>

  | TIOCGETP, I would presume.

No.  SIGTTOU is generated only for ioctls that alter the
terminal state in some way.  But readline will be doing
that, if not in the place you reported.  It wants terninal
echo off, and 'cbreak' mode (which these days is a combination
of settings rather than a particular individual setting).

Or, of course, attempting output from a background process
(one whose process group is not the pg assigned to the terminal)
to a tty with the tostop mode enabled - but I suspect that is
very rarely done these days.

Querying the tty state is harmless, even for background
processes, and always works.

  | The question is, why python tries to init readline when it's executing
  | a script and is not going to read any user input.

It is python - does whatever it likes.   Stupid certainly.

kre


Home | Main Index | Thread Index | Old Index