Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rich.traceback -- do not wrap long lines #16

Closed
wookayin opened this issue Mar 8, 2020 · 3 comments
Closed

rich.traceback -- do not wrap long lines #16

wookayin opened this issue Mar 8, 2020 · 3 comments

Comments

@wookayin
Copy link

wookayin commented Mar 8, 2020

rich.traceback makes stacktrace nicer but it wraps everything in 80 characters.

For example, see a screenshot in your blog post -- https://www.willmcgugan.com/blog/tech/post/better-python-tracebacks-with-rich/.

Traceback (most recent call last):
╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ File                                                                                             │
│"/home/USERNAME/.miniconda3/envs/longer-paths-for-reasons/lib/python3.7/site-packages/numpy/core/f│
│line 1477, in squeeze                                                                             │
    (... omitted)
│
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

As it truncates the full stacktrace line at certain characters, it becomes inconvenient for users to see which file to look at. I suggest we should not wrap them inside a box.

@willmcgugan
Copy link
Collaborator

It's the width of the code or the width of the terminal that defines how much space is used for the traceback (whichever is smaller). To make the traceback wider so it doesn't wrap, set width to your desired value, or set it to None to use all available width. See traceback docs.

@wookayin
Copy link
Author

wookayin commented Mar 8, 2020

Thanks. The width=None option works for me. Is there any option to disable drawing box as well?

@wookayin
Copy link
Author

wookayin commented Mar 9, 2020

However, with width=None log messages are still truncated at the terminal width. I think there should be a way (i) to disable boxes or (ii) to print the whole line wrapped and continued on the next line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants