regro / rever

Releaser of Versions
https://regro.github.io/rever-docs/
BSD 3-Clause "New" or "Revised" License
74 stars 34 forks source link

Have to Control-C a thousand times to stop rever #18

Open asmeurer opened 7 years ago

asmeurer commented 7 years ago

I want to press Control-C just once to stop rever. I thought this was fixed in xonsh.

asmeurer commented 7 years ago

See https://github.com/xonsh/xonsh/issues/1743, which was supposedly fixed.

scopatz commented 7 years ago

This really should have been fixed. Can you reproduce it in pure xonsh?

asmeurer commented 7 years ago

Not sure how complex it needs to be. I did just get this though

Traceback (most recent call last):
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/base_shell.py", line 328, in default
    run_compiled_code(code, self.ctx, None, 'single')
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/codecache.py", line 68, in run_compiled_code
    func(code, glb, loc)
  File "<xonsh-code>", line 2, in <module>
  File "<xonsh-code>", line 2, in test
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/built_ins.py", line 877, in subproc_captured_hiddenobject
    return run_subproc(cmds, captured='hiddenobject')
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/built_ins.py", line 813, in run_subproc
    command = HiddenCommandPipeline(specs)
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/proc.py", line 1767, in __init__
    proc = spec.run(pipeline_group=pipeline_group)
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/built_ins.py", line 502, in run
    p = self._run_binary(kwargs)
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/built_ins.py", line 512, in _run_binary
    p = self.cls(self.cmd, bufsize=bufsize, **kwargs)
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/proc.py", line 559, in __init__
    **kwargs)
  File "/Users/aaronmeurer/anaconda3/envs/python36/lib/python3.6/subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "/Users/aaronmeurer/anaconda3/envs/python36/lib/python3.6/subprocess.py", line 1260, in _execute_child
    restore_signals, start_new_session, preexec_fn)
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/proc.py", line 765, in _signal_int
    signal.pthread_kill(threading.get_ident(), signal.SIGINT)
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/proc.py", line 765, in _signal_int
    signal.pthread_kill(threading.get_ident(), signal.SIGINT)
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/proc.py", line 765, in _signal_int
    signal.pthread_kill(threading.get_ident(), signal.SIGINT)
  [Previous line repeated 319 more times]
  File "/Users/aaronmeurer/Documents/xonsh/xonsh/proc.py", line 761, in _signal_int
    self.send_signal(signum)
RecursionError: maximum recursion depth exceeded

That's from

python36xonshmaster%=🐚 def test():
.......................     echo test
.......................
python36xonshmaster%=🐚 while 1:
.......................     test()
.......................
.......................
BMaxV commented 3 years ago

Hi, I found #1743 first, not sure how they're related.

Sorry for the messed up styling, github doesn't work correctly in my browser, how do you write code as code again?

I tried the example for the homepage

for filename in .*: print(filename) du -sh @(filename)

And I couldn't interrupt it... not really. I tried to, then it did nothing for a short while and here is my traceback:

^C

Exception ignored in: <function _after_fork at 0x7f8cb704c8b0> Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 1456, in _after_fork thread._reset_internal_locks(False) File "/usr/lib/python3.8/threading.py", line 811, in _reset_internal_locks self._started._reset_internal_locks() File "/usr/lib/python3.8/threading.py", line 509, in _reset_internal_locks def _reset_internal_locks(self): File "/home/max/.local/lib/python3.8/site-packages/xonsh/procs/posix.py", line 308, in _signal_int signal.pthread_kill(threading.get_ident(), signal.SIGINT) File "/home/max/.local/lib/python3.8/site-packages/xonsh/procs/posix.py", line 308, in _signal_int signal.pthread_kill(threading.get_ident(), signal.SIGINT) File "/home/max/.local/lib/python3.8/site-packages/xonsh/procs/posix.py", line 308, in _signal_int signal.pthread_kill(threading.get_ident(), signal.SIGINT) [Previous line repeated 484 more times] File "/home/max/.local/lib/python3.8/site-packages/xonsh/procs/posix.py", line 304, in _signal_int self.send_signal(signal.CTRL_C_EVENT if xp.ON_WINDOWS else signum) File "/home/max/.local/lib/python3.8/site-packages/xonsh/procs/posix.py", line 476, in send_signal while self.proc is None and dt < self.timeout: RecursionError: maximum recursion depth exceeded in comparison xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True RecursionError: maximum recursion depth exceeded in comparison

It makes sense to not do anything for a while when it's doing recursion...

But let's be real, I am not confident enough that my code is 100% correct and I don't start something by accident that will not finish or not finish in reasonable time. So this is a real problem :/

to reproduce here are some simple test files

c=0 m=200 while c < m: with open("testfile"+str(c)+".txt","w") as f: f.write("hello there lore ipsum") c+=1