xonsh / xonsh

:shell: Python-powered shell. Full-featured and cross-platform.
http://xon.sh
Other
8.31k stars 634 forks source link

xonsh crashes over python 3.7 #2593

Closed jgmtzmd closed 6 years ago

jgmtzmd commented 6 years ago

hi. i have to installs of xonsh: over python3.4 (installed by my package manager zypper of opensuse 42.3), and over python3.7 (i will call this xonsh37) xonsh37 crashes all the time.

example: jg@Osuse ~ $ top -o COMAND works fine. But when i exit (either q or ctrl-c).. this happens..

xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
  File "/opt/python/lib/python3.7/site-packages/xonsh/proc.py", line 1837, in iterraw
    raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/python/lib/python3.7/site-packages/xonsh/base_shell.py", line 328, in default
    run_compiled_code(code, self.ctx, None, 'single')
  File "/opt/python/lib/python3.7/site-packages/xonsh/codecache.py", line 68, in run_compiled_code
    func(code, glb, loc)
  File "/opt/python/lib/python3.7/site-packages/xontrib/vox_tabcomplete.xsh", line 1, in <module>
    def _vox_completer(prefix, line, begidx, endidx, ctx):
  File "/opt/python/lib/python3.7/site-packages/xonsh/built_ins.py", line 877, in subproc_captured_hiddenobject
    return run_subproc(cmds, captured='hiddenobject')
  File "/opt/python/lib/python3.7/site-packages/xonsh/built_ins.py", line 840, in run_subproc
    command.end()
  File "/opt/python/lib/python3.7/site-packages/xonsh/proc.py", line 2010, in end
    self._end(tee_output=tee_output)
  File "/opt/python/lib/python3.7/site-packages/xonsh/proc.py", line 2018, in _end
    for _ in self.tee_stdout():
  File "/opt/python/lib/python3.7/site-packages/xonsh/proc.py", line 1934, in tee_stdout
    for line in self.iterraw():
RuntimeError: generator raised StopIteration
jg@Osuse ~ $                                                                                                    
xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
  File "/opt/python/lib/python3.7/site-packages/xonsh/ptk/shortcuts.py", line 109, in prompt
    document = cli.run(reset_current_buffer=False)
  File "/opt/python/lib/python3.7/site-packages/prompt_toolkit/interface.py", line 411, in run
    with self.input.raw_mode():
  File "/opt/python/lib/python3.7/site-packages/prompt_toolkit/terminal/vt100_input.py", line 470, in __enter__
    termios.tcsetattr(self.fileno, termios.TCSANOW, newattr)
termios.error: (5, 'Input/output error')

you can see that this loop repeats even presing ctrl-c. i have to close the terminal to exit.

here ara details of my two xonsh's bad one (xonsh37)

jg@Osuse ~ $ xonfig
+------------------+----------------------+
| xonsh            | 0.6.0                |
| Git SHA          | c29819c5             |
| Commit Date      | Nov 22 17:51:52 2017 |
| Python           | 3.7.0                |
| PLY              | 3.9                  |
| have readline    | True                 |
| prompt toolkit   | 1.0.15               |
| shell type       | prompt_toolkit       |
| pygments         | 2.2.0                |
| on posix         | True                 |
| on linux         | True                 |
| distro           | unknown              |
| on darwin        | False                |
| on windows       | False                |
| on cygwin        | False                |
| is superuser     | False                |
| default encoding | utf-8                |
| xonsh encoding   | utf-8                |
| encoding errors  | surrogateescape      |
+------------------+----------------------+

good one

jg@Osuse ~ $ xonfig
+------------------+----------------------+
| xonsh            | 0.5.8                |
| Git SHA          | c29819c5             |
| Commit Date      | Nov 22 17:51:52 2017 |
| Python           | 3.4.6                |
| PLY              | 3.6                  |
| have readline    | True                 |
| prompt toolkit   | 1.0.3                |
| shell type       | prompt_toolkit       |
| pygments         | 2.0.2                |
| on posix         | True                 |
| on linux         | True                 |
| distro           | openSUSE             |
| on darwin        | False                |
| on windows       | False                |
| on cygwin        | False                |
| is superuser     | False                |
| default encoding | utf-8                |
| xonsh encoding   | utf-8                |
| encoding errors  | surrogateescape      |
+------------------+----------------------+

i saw that prompt_toolkit here is different version than my other xonsh install. i copied all the prompt_toolkit directory to site-packages of python37 and stills crashes.

gforsyth commented 6 years ago

Hi @jgmtzmd -- thanks for reporting. I don't know that we'll get to Python 3.7 until there is a release candidate (at the earliest) unless someone wants to take that on before then. You should be good to go if you use 3.6.4

jgmtzmd commented 6 years ago

ok. working fine with 3.6 thanks.

scopatz commented 6 years ago

Yeah, I agree with @gforsyth about the timeline

jaraco commented 6 years ago

I've been using xonsh on Python 3.7.0b3 with success. I believe this issue can be closed.

scopatz commented 6 years ago

Great!