-
Notifications
You must be signed in to change notification settings - Fork 134
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
Getting 'PosixPath' object has no attribute 'lower' with django #345
Comments
The Rollbar library is expecting a Modify your rollbar settings in import rollbar
ROLLBAR = {
"access_token": "12345"
"environment": "development" if DEBUG else "production",
"root": str(BASE_DIR)
}
rollbar.init(**ROLLBAR) |
Got it, thanks for the response. Might be worth updating rollbar config at some point to accept a PosixPath since django switched to Paths in settings.py as default since 3.x |
dragon-dxw
added a commit
to nationalarchives/ds-caselaw-public-ui
that referenced
this issue
Aug 24, 2023
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
added a commit
to nationalarchives/ds-caselaw-public-ui
that referenced
this issue
Aug 24, 2023
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.
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I configured integration with django following the docs, however when an exception is raise somewhere in the app I get in addition
Is there a way to get rid of that?
The text was updated successfully, but these errors were encountered: