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

Fix Traceback.from_exception ignores locals_max_length and locals_max_string #2650

Closed
wants to merge 3 commits into from

Conversation

giladbarnea
Copy link

@giladbarnea giladbarnea commented Nov 15, 2022

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

This fixes:
Issue 2649: Traceback.from_exception ignores locals_max_length and locals_max_string arguments.

Bug description

Specifying locals_max_length and locals_max_string when using Traceback.from_exception had no effect; the defaults LOCALS_MAX_LENGTH and LOCALS_MAX_STRING were used instead.

Fix

Traceback.from_exception internally calls cls.extract. It passes down all the arguments Traceback.extract supports besides locals_max_length and locals_max_string. I made it also pass locals_max_length and locals_max_string to Traceback.extract.

@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2022

Codecov Report

Base: 98.39% // Head: 98.39% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (f2b5e0c) compared to base (6e953c6).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2650      +/-   ##
==========================================
- Coverage   98.39%   98.39%   -0.01%     
==========================================
  Files          63       63              
  Lines        6806     6796      -10     
==========================================
- Hits         6697     6687      -10     
  Misses        109      109              
Flag Coverage Δ
unittests 98.39% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
rich/_null_file.py 100.00% <ø> (ø)
rich/pretty.py 98.98% <ø> (-0.01%) ⬇️
rich/rule.py 100.00% <ø> (ø)
rich/traceback.py 98.68% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@giladbarnea giladbarnea closed this by deleting the head repository Nov 23, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants