vaaaaanquish-xx / xontrib-readable-traceback

Make traceback easier to see for xonsh.
Other
2 stars 0 forks source link

Exception is not displayed immediately #3

Closed vaaaaanquish-xx closed 6 years ago

vaaaaanquish-xx commented 6 years ago

It is buffered and not displayed as follows

$ 1/0
$
$ print(1-)
$ exit

Traceback (Most recent call last):
14820 __amalgam__.py default --> run_compiled_code(code, self.ctx, None, 'single')
2322 __amalgam__.py run_compiled_code --> func(code, glb, loc)
1 readable-traceback.xsh <module> --> import xonsh.tools
ZeroDivisionError: division by zero
Traceback (Most recent call last):
137 shell.py _push --> locs=None)
19877 __amalgam__.py compile --> transform=transform)
19846 __amalgam__.py parse --> tree, input = self._parse_ctx_free(input, mode=mode, filename=filename)
19946 __amalgam__.py _parse_ctx_free --> raise original_error from None
19933 __amalgam__.py _parse_ctx_free --> debug_level=(self.debug_level > 2))
349 base.py parse --> tree = self.parser.parse(input=s, lexer=self.lexer, debug=debug_level)
331 yacc.py parse --> return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
1181 yacc.py parseopt_notrack --> tok = call_errorfunc(self.errorfunc, errtoken, self)
...
vaaaaanquish-xx commented 6 years ago

add sys.stderr.flush() https://github.com/vaaaaanquish/xontrib-readable-traceback/commit/642a89114ebca789a7cd6c762840923e611d7e65

t184256 commented 6 years ago

Is this already in 0.2.2?

vaaaaanquish-xx commented 6 years ago

@t184256 Yes. If you don't see traceback, please tell me your system requirements. I'm just investigating xonsh's stdout.