Repository navigation
command.process() fails if the terminal is missing #1264
Copy link
Copy link
Open
Description
Reported by AlexPortable in #limnoria:
ERROR 2016-09-11T18:24:13 supybot Uncaught exception in _callRegexp:
Traceback (most recent call last):
File "/home/alexportable/.local/lib/python3.5/site-packages/supybot/callbacks.py", line 1478, in _callRegexp
method(irc, msg, m)
File "/home/alexportable/limnoria/plugins/SedRegex/plugin.py", line 148, in replacer
fcn_name='replacer'):
File "/home/alexportable/.local/lib/python3.5/site-packages/supybot/commands.py", line 149, in regexp_wrapper
v = process(re_bool, s, reobj, timeout=timeout, pn=plugin_name, cn=fcn_name)
File "/home/alexportable/.local/lib/python3.5/site-packages/supybot/commands.py", line 119, in process
p.start()
File "/home/alexportable/.local/lib/python3.5/multiprocessing/process.py", line 105, in start
self._popen = self._Popen(self)
File "/home/alexportable/.local/lib/python3.5/multiprocessing/context.py", line 212, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/home/alexportable/.local/lib/python3.5/multiprocessing/context.py", line 267, in _Popen
return Popen(process_obj)
File "/home/alexportable/.local/lib/python3.5/multiprocessing/popen_fork.py", line 17, in __init__
sys.stdout.flush()
OSError: [Errno 5] Input/output error
ERROR 2016-09-11T18:24:13 supybot Exception id: 0x28bfa
Relevant conversation:
09:28 <tacocat> AlexPortable: is supybot running daemonized, in the foreground, or sent to the background?
09:29 <AlexPortable> foregroudn
09:29 <AlexPortable> but my terminal closed due to inactivity
09:29 <AlexPortable> other plugins work fine
09:30 <tacocat> can you restart your bot with 'supybot -d' so that it forks to the background
09:30 <tacocat> doing a bit of research and sys.stdXXX.flush() failing may be because the terminal is dead
09:30 <AlexPortable> i start it with crontab
09:31 <tacocat> use supybot -d there
09:31 <tacocat> i'm not sure crontab even exposes a terminal for the bot to attach to
09:32 <AlexPortable> so shutdown the bot and try again?
09:32 <tacocat> yes but don't do anything to make it lose terminal
09:32 <AlexPortable> supybot -d bot.conf ?
09:32 <tacocat> if you daemonize it there is no terminal
09:32 <tacocat> yup
09:33 <AlexPortable> done
09:34 <AlexPortable> hm m the other plugins work too :D
09:34 <AlexPortable> thanks :D
Reactions are currently unavailable
Activity
progval commentedon Sep 11, 2016
hmm... isn't it a bug in CPython?
progval commentedon Oct 1, 2016
Submitted to Python's bugtracker. https://bugs.python.org/issue28326
progval commentedon Oct 22, 2017
This issue will be fixed on Python 3.6.4: python/cpython#4075
jlu5 commentedon Jan 25, 2018
3.6.4 has been released, so I think this can be closed now.Not quite, python/cpython#4075 (comment)
sunbarve commentedon May 25, 2018
Is this issue solve for python3.5?
File "/home/alexportable/.local/lib/python3.5/multiprocessing/popen_fork.py", line 17, in init
sys.stdout.flush()
OSError: [Errno 5] Input/output error
progval commentedon May 25, 2018
No, you need at least Python 3.6.4.
sunbarve commentedon May 25, 2018
@progval i have upgraded python to 3.6.4, but still get this error.
File "/usr/local/lib/python3.6/multiprocessing/popen_fork.py", line 18, in init
sys.stdout.flush()
OSError: [Errno 5] Input/output error
progval commentedon May 25, 2018
What does
python3 -Vshow?sunbarve commentedon May 26, 2018
@progval
1.if i just use python3 -V then it shown Python 3.5.2
2.if use python3.6 -V then it shows Python 3.6.4
jothiljose commentedon Aug 1, 2018
I am also facing this same while hosting in AWS,
Just remove the code sys.stdout.flush() from source file , now its working perfectly.
let me know, Is this make any issue in future?
progval commentedon Aug 1, 2018
@jothiljose You should use this patch: https://github.com/python/cpython/pull/4075/files but replace
except (AttributeError, ValueError):withexcept (AttributeError, ValueError, OSError):traumschule commentedon Dec 13, 2018
Hi! I see the same issue with current limnoria after the parent tmux had died.
Will try the linked patch.