rich
rich copied to clipboard
Support pyinstaller relative paths in Traceback (#2251)
Type of changes
- [X] Bug fix
Checklist
- [x] I've run the latest black with default args on new code.
- [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
- [ ] I've added tests for new code.
- [x] I accept that @willmcgugan may be pedantic in the code review.
Description
In rich.traceback.Traceback.extract, if frame_summary.f_code.co_filename isn't an absolute path, we now check if we're running in a pyinstaller bundle, and will fabricate a file name to avoid errors. See #2251 for details.
Struggling to mock a traceback for a test. We can't just use one from sys.exc_info as we wouldn't hit the new code, we need a relative path. All of the attributes we need on a traceback are read only.
Closing. Assumed stale. Feel free to reopen if you want to continue work on it.