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

❓ Coerce rollbar config path to a string #873

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

dragon-dxw
Copy link
Collaborator

@dragon-dxw dragon-dxw commented Aug 24, 2023

We have regular issues with errors ending in:

During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/rollbar/__init__.py", line 1026, in _add_locals_data if arginfo.locals and _check_add_locals(cur_frame, frame_num, num_frames):
File "/usr/local/lib/python3.11/site-packages/rollbar/__init__.py", line 1129, in _check_add_locals ('root' in SETTINGS and (frame.get('filename') or '').lower().startswith((SETTINGS['root'] or '').lower()))))
AttributeError: 'PosixPath' object has no attribute 'lower'

rollbar/pyrollbar#345 suggests this is caused by rollbar reciving a PosixPath not a string, so we coerce it before passing it to the config.

@codecov-commenter
Copy link

Codecov Report

Merging #873 (17e58b5) into main (bf2e317) will not change coverage.
Report is 8 commits behind head on main.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #873   +/-   ##
=======================================
  Coverage   93.72%   93.72%           
=======================================
  Files          33       33           
  Lines        1418     1418           
  Branches      226      226           
=======================================
  Hits         1329     1329           
  Misses         69       69           
  Partials       20       20           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/rollbar/__init__.py", line 1026, in _add_locals_data
if arginfo.locals and _check_add_locals(cur_frame, frame_num, num_frames):
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/rollbar/__init__.py", line 1129, in _check_add_locals
('root' in SETTINGS and (frame.get('filename') or '').lower().startswith((SETTINGS['root'] or '').lower()))))
                                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PosixPath' object has no attribute 'lower'

rollbar/pyrollbar#345 suggests this is caused by rollbar reciving a PosixPath not a string, so we coerce it before passing it to the config.
@dragon-dxw dragon-dxw force-pushed the force-rollbar-root-to-be-string-not-path branch from 17e58b5 to ec9897c Compare August 24, 2023 15:35
@dragon-dxw dragon-dxw changed the title Coerce rollbar config path to a string ❓ Coerce rollbar config path to a string Aug 24, 2023
@dragon-dxw dragon-dxw added this pull request to the merge queue Aug 24, 2023
Merged via the queue into main with commit 41f7118 Aug 24, 2023
7 checks passed
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.

4 participants