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

Fixed #398 FastAPI integration fails if docs are disabled. #454

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion rollbar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ def _build_starlette_request_data(request):
'params': dict(request.path_params),
}

if hasattr(request, '_form'):
if hasattr(request, '_form') and request._form is not None:
request_data['POST'] = {
k: v.filename if isinstance(v, UploadFile) else v
for k, v in request._form.items()
Expand Down Expand Up @@ -1772,4 +1772,8 @@ def _wsgi_extract_user_ip(environ):


def _starlette_extract_user_ip(request):
if not hasattr(request, 'client'):
return _extract_user_ip_from_headers(request)
if not hasattr(request.client, 'host'):
return _extract_user_ip_from_headers(request)
return request.client.host or _extract_user_ip_from_headers(request)
25 changes: 14 additions & 11 deletions rollbar/contrib/fastapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,20 @@ def get_installed_middlewares(app):
return middlewares


def has_bare_routing(app_or_router):
expected_app_routes = 4
expected_router_routes = 0

if (
isinstance(app_or_router, FastAPI)
and expected_app_routes != len(app_or_router.routes)
) or (
isinstance(app_or_router, APIRouter)
and expected_router_routes != len(app_or_router.routes)
):
def has_bare_routing(app_or_router: FastAPI | APIRouter):
if not isinstance(app_or_router, (FastAPI, APIRouter)):
return False

urls = [
getattr(app_or_router, 'openapi_url', None),
getattr(app_or_router, 'docs_url', None),
getattr(app_or_router, 'redoc_url', None),
getattr(app_or_router, 'swagger_ui_oauth2_redirect_url', None),
]

for route in app_or_router.routes:
if route is None or route.path in urls:
continue
return False

return True
2 changes: 2 additions & 0 deletions rollbar/lib/transforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def transform(obj, transforms, key=None, batch_transforms=False):
transforms = [BatchedTransform(transforms)]

for transform in transforms:
if not isinstance(transform, Transform):
continue
obj = _transform(obj, transform, key=key)

return obj
Expand Down
5 changes: 3 additions & 2 deletions rollbar/test/fastapi_tests/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_should_add_framework_version_to_payload(self, mock_send_payload, *mocks

app = FastAPI()
app.add_middleware(LoggerMiddleware)
app.build_middleware_stack()

rollbar.report_exc_info()

Expand Down Expand Up @@ -70,10 +71,10 @@ def test_should_store_current_request(self, store_current_request):
'client': ['testclient', 50000],
'headers': [
(b'host', b'testserver'),
(b'user-agent', b'testclient'),
(b'accept-encoding', b'gzip, deflate'),
(b'accept', b'*/*'),
(b'accept-encoding', b'gzip, deflate'),
(b'connection', b'keep-alive'),
(b'user-agent', b'testclient'),
],
'http_version': '1.1',
'method': 'GET',
Expand Down
8 changes: 5 additions & 3 deletions rollbar/test/fastapi_tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import rollbar
from rollbar.lib._async import AsyncMock
from rollbar.test import BaseTest
from rollbar.test.utils import get_public_attrs

ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)

Expand Down Expand Up @@ -152,6 +153,7 @@ def test_should_add_framework_version_to_payload(self, mock_send_payload, *mocks

app = FastAPI()
app.add_middleware(ReporterMiddleware)
app.build_middleware_stack()

rollbar.report_exc_info()

Expand Down Expand Up @@ -272,10 +274,10 @@ def test_should_store_current_request(self, store_current_request):
'client': ['testclient', 50000],
'headers': [
(b'host', b'testserver'),
(b'user-agent', b'testclient'),
(b'accept-encoding', b'gzip, deflate'),
(b'accept', b'*/*'),
(b'accept-encoding', b'gzip, deflate'),
(b'connection', b'keep-alive'),
(b'user-agent', b'testclient'),
],
'http_version': '1.1',
'method': 'GET',
Expand Down Expand Up @@ -324,7 +326,7 @@ def test_should_return_current_request(self):
async def read_root(original_request: Request):
request = get_current_request()

self.assertEqual(request, original_request)
self.assertEqual(get_public_attrs(request), get_public_attrs(original_request))

client = TestClient(app)
client.get('/')
Expand Down
5 changes: 3 additions & 2 deletions rollbar/test/starlette_tests/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_should_add_framework_version_to_payload(self, mock_send_payload, *mocks

app = Starlette()
app.add_middleware(LoggerMiddleware)
app.build_middleware_stack()

rollbar.report_exc_info()

Expand Down Expand Up @@ -67,10 +68,10 @@ def test_should_store_current_request(self, store_current_request):
'client': ['testclient', 50000],
'headers': [
(b'host', b'testserver'),
(b'user-agent', b'testclient'),
(b'accept-encoding', b'gzip, deflate'),
(b'accept', b'*/*'),
(b'accept-encoding', b'gzip, deflate'),
(b'connection', b'keep-alive'),
(b'user-agent', b'testclient'),
],
'http_version': '1.1',
'method': 'GET',
Expand Down
8 changes: 5 additions & 3 deletions rollbar/test/starlette_tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import rollbar
from rollbar.lib._async import AsyncMock
from rollbar.test import BaseTest
from rollbar.test.utils import get_public_attrs

ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)

Expand Down Expand Up @@ -138,6 +139,7 @@ def test_should_add_framework_version_to_payload(self, mock_send_payload, *mocks

app = Starlette()
app.add_middleware(ReporterMiddleware)
app.build_middleware_stack()

rollbar.report_exc_info()

Expand Down Expand Up @@ -243,10 +245,10 @@ def test_should_store_current_request(self, store_current_request):
'client': ['testclient', 50000],
'headers': [
(b'host', b'testserver'),
(b'user-agent', b'testclient'),
(b'accept-encoding', b'gzip, deflate'),
(b'accept', b'*/*'),
(b'accept-encoding', b'gzip, deflate'),
(b'connection', b'keep-alive'),
(b'user-agent', b'testclient'),
],
'http_version': '1.1',
'method': 'GET',
Expand Down Expand Up @@ -290,7 +292,7 @@ def test_should_return_current_request(self):
async def root(original_request):
request = get_current_request()

self.assertEqual(request, original_request)
self.assertEqual(get_public_attrs(request), get_public_attrs(original_request))

return PlainTextResponse('OK')

Expand Down
5 changes: 3 additions & 2 deletions rollbar/test/starlette_tests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import unittest

from rollbar.test import BaseTest
from rollbar.test.utils import get_public_attrs

ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)

Expand Down Expand Up @@ -49,7 +50,7 @@ def test_should_accept_request_param(self):

stored_request = store_current_request(request)

self.assertEqual(request, stored_request)
self.assertEqual(get_public_attrs(request), get_public_attrs(stored_request))

def test_should_accept_scope_param_if_http_type(self):
from starlette.requests import Request
Expand Down Expand Up @@ -81,7 +82,7 @@ def test_should_accept_scope_param_if_http_type(self):

request = store_current_request(scope, receive)

self.assertEqual(request, expected_request)
self.assertEqual(get_public_attrs(request), get_public_attrs(expected_request))

def test_should_not_accept_scope_param_if_not_http_type(self):
from rollbar.contrib.starlette.requests import store_current_request
Expand Down
12 changes: 7 additions & 5 deletions rollbar/test/test_rollbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from rollbar.lib import string_types

from rollbar.test import BaseTest
from rollbar.test.utils import get_public_attrs

try:
eval("""
Expand Down Expand Up @@ -173,6 +174,7 @@
body = b'body body body'
scope = {
'type': 'http',
'client': ('127.0.0.1', 1453),
'headers': [
(b'content-type', b'text/html'),
(b'content-length', str(len(body)).encode('latin-1')),
Expand Down Expand Up @@ -410,7 +412,7 @@
def root(starlette_request):
current_request = rollbar.get_request()

self.assertEqual(current_request, starlette_request)
self.assertEqual(get_public_attrs(current_request), get_public_attrs(starlette_request))

return PlainTextResponse("bye bye")

Expand All @@ -437,7 +439,7 @@
def root(starlette_request):
current_request = rollbar.get_request()

self.assertEqual(current_request, starlette_request)
self.assertEqual(get_public_attrs(current_request), get_public_attrs(starlette_request))

return PlainTextResponse("bye bye")

Expand Down Expand Up @@ -465,7 +467,7 @@
def root(param, fastapi_request: Request):
current_request = rollbar.get_request()

self.assertEqual(current_request, fastapi_request)
self.assertEqual(get_public_attrs(current_request), get_public_attrs(fastapi_request))

root = fastapi_add_route_with_request_param(
app, root, '/{param}', 'fastapi_request'
Expand All @@ -492,7 +494,7 @@
def root(fastapi_request: Request):
current_request = rollbar.get_request()

self.assertEqual(current_request, fastapi_request)
self.assertEqual(get_public_attrs(current_request), get_public_attrs(fastapi_request))

root = fastapi_add_route_with_request_param(
app, root, '/{param}', 'fastapi_request'
Expand Down Expand Up @@ -523,7 +525,7 @@
def root(fastapi_request: Request):
current_request = rollbar.get_request()

self.assertEqual(current_request, fastapi_request)
self.assertEqual(get_public_attrs(current_request), get_public_attrs(fastapi_request))

root = fastapi_add_route_with_request_param(
app, root, '/{param}', 'fastapi_request'
Expand Down Expand Up @@ -933,7 +935,7 @@
# self.assertEqual(_send_failsafe.call_count, 1)

try:
raise Exception('trigger_failsafe')

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, DJANGO_VERSION=2.2.28)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, PYRAMID_VERSION=1.10.8)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, FLASK_VERSION=2.2.3)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, DJANGO_VERSION=4.0.10)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, FLASK_VERSION=2.2.3)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, DJANGO_VERSION=3.2.18)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, TWISTED_VERSION=22.10.0)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, DJANGO_VERSION=4.0.10)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, FLASK_VERSION=1.1.4)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, TWISTED_VERSION=22.10.0)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, DJANGO_VERSION=3.2.18)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, FLASK_VERSION=1.1.4)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, DJANGO_VERSION=2.2.28)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, PYRAMID_VERSION=1.10.8)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, FLASK_VERSION=1.1.4)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, FLASK_VERSION=2.2.3)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, DJANGO_VERSION=1.11.29)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, DJANGO_VERSION=2.2.28)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, FLASK_VERSION=1.1.4)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, DJANGO_VERSION=2.2.28)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, PYRAMID_VERSION=1.10.8)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, TWISTED_VERSION=21.7.0)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, DJANGO_VERSION=2.2.28)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, FLASK_VERSION=1.1.4)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, FLASK_VERSION=1.1.4)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, DJANGO_VERSION=4.1.7)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, DJANGO_VERSION=1.11.29)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, DJANGO_VERSION=4.0.10)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, DJANGO_VERSION=3.2.18)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, DJANGO_VERSION=4.1.7)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, FLASK_VERSION=2.2.3)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, DJANGO_VERSION=4.0.10)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, FLASK_VERSION=2.2.3)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, PYRAMID_VERSION=1.10.8)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, DJANGO_VERSION=4.1.7)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, DJANGO_VERSION=4.1.7)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, DJANGO_VERSION=3.2.18)

trigger_failsafe

Check failure on line 938 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, DJANGO_VERSION=2.2.28)

trigger_failsafe
except:
rollbar._post_api('/api/1/item', {'derp'})

Expand Down Expand Up @@ -1063,7 +1065,7 @@

try:
t = tmp()
raise Exception('trigger_serialize')

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, DJANGO_VERSION=2.2.28)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, PYRAMID_VERSION=1.10.8)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, FLASK_VERSION=2.2.3)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, DJANGO_VERSION=4.0.10)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, FLASK_VERSION=2.2.3)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, DJANGO_VERSION=3.2.18)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, TWISTED_VERSION=22.10.0)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, DJANGO_VERSION=4.0.10)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, FLASK_VERSION=1.1.4)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, TWISTED_VERSION=22.10.0)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, DJANGO_VERSION=3.2.18)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, FLASK_VERSION=1.1.4)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, DJANGO_VERSION=2.2.28)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, PYRAMID_VERSION=1.10.8)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, FLASK_VERSION=1.1.4)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, FLASK_VERSION=2.2.3)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, DJANGO_VERSION=1.11.29)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, DJANGO_VERSION=2.2.28)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, FLASK_VERSION=1.1.4)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, DJANGO_VERSION=2.2.28)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, PYRAMID_VERSION=1.10.8)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, TWISTED_VERSION=21.7.0)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, DJANGO_VERSION=2.2.28)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, FLASK_VERSION=1.1.4)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, FLASK_VERSION=1.1.4)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.10, DJANGO_VERSION=4.1.7)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.6, DJANGO_VERSION=1.11.29)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, DJANGO_VERSION=4.0.10)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, DJANGO_VERSION=3.2.18)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.11, DJANGO_VERSION=4.1.7)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, FLASK_VERSION=2.2.3)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, DJANGO_VERSION=4.0.10)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, FLASK_VERSION=2.2.3)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, PYRAMID_VERSION=1.10.8)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.9, DJANGO_VERSION=4.1.7)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, DJANGO_VERSION=4.1.7)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.8, DJANGO_VERSION=3.2.18)

trigger_serialize

Check failure on line 1068 in rollbar/test/test_rollbar.py

View workflow job for this annotation

GitHub Actions / build (3.7, DJANGO_VERSION=2.2.28)

trigger_serialize
except:
rollbar.report_exc_info()

Expand Down
4 changes: 4 additions & 0 deletions rollbar/test/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from collections.abc import Mapping

def get_public_attrs(obj: Mapping) -> dict:
return {k: obj[k] for k in obj if not k.startswith('_')}
Loading