npilon / pyramid_crow Goto Github PK
View Code? Open in Web Editor NEWhttp context compliant automatic raven integration for pyramid
License: Apache License 2.0
http context compliant automatic raven integration for pyramid
License: Apache License 2.0
There's only a few of them; detect them in settings and auto-bool-ify them.
In my application, when i call config.include('pyramid_crow')
it calls config.scan() and then that finds tests.py, can you ignore it? I don't install webtests on deployments, on my local sure, but not when i deploy to any other environment.
getsentry/raven-python#812 which was released in raven-6.2.0 on 21-Sep-2017 causes a ModuleNotFoundError
in pyramid_crow-0.4.0. Rolling raven back to 6.1.0 eliminates the error.
Traceback:
Error in sys.excepthook:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/pyramid_crow/processors.py", line 3, in <module>
from raven._compat import (
ModuleNotFoundError: No module named 'raven._compat'
Original exception was:
Traceback (most recent call last):
File "/home/sealinkd/miniconda/envs/sealinkd/bin/pserve", line 11, in <module>
sys.exit(main())
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/pyramid/scripts/pserve.py", line 32, in main
return command.run()
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/pyramid/scripts/pserve.py", line 229, in run
app = loader.get_wsgi_app(app_name, config_vars)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/plaster_pastedeploy/__init__.py", line 131, in get_wsgi_app
global_conf=defaults)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/paste/deploy/loadwsgi.py", line 203, in invoke
app = context.app_context.create()
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/paste/deploy/util.py", line 55, in fix_call
val = callable(*args, **kw)
File "/home/sealinkd/SealinkD/sealinkd/__init__.py", line 31, in main
with Configurator(settings=settings) as config:
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/pyramid/config/__init__.py", line 345, in __init__
exceptionresponse_view=exceptionresponse_view,
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/pyramid/config/__init__.py", line 463, in setup_registry
self.include(inc)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/pyramid/config/__init__.py", line 839, in include
c(configurator)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/pyramid_crow/__init__.py", line 138, in includeme
config.scan(ignore='pyramid_crow.tests')
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/pyramid/config/__init__.py", line 1043, in scan
ignore=ignore)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/venusian/__init__.py", line 230, in scan
__import__(modname)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.6/site-packages/pyramid_crow/processors.py", line 3, in <module>
from raven._compat import (
ModuleNotFoundError: No module named 'raven._compat'
Thanks for creating pyramid-crow
!
I tried it today in a Python-3.5, pyramid-1.5.7 project and got the traceback below and (obviously?) nothing sent to sentry. I commented out the over-long request body handling code:
# if request.content_length < 2**16
# else 'Over-long request body of {} bytes omitted'.format(
# request.content_length
# )
starting at https://github.com/npilon/pyramid_crow/blob/master/pyramid_crow/__init__.py#L26 and the exception went through to sentry.
I will try to produce a minimal case to reproduce the issue sometime this week, but wanted to raise the issue immediately in case there is something very obvious that I am overlooking.
Traceback
Traceback (most recent call last):
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.5/site-packages/pyramid_debugtoolbar-2.4.1-py3.5.egg/pyramid_debugtoolbar/toolbar.py", line 192, in toolbar_tween
response = _handler(request)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.5/site-packages/pyramid_debugtoolbar-2.4.1-py3.5.egg/pyramid_debugtoolbar/panels/performance.py", line 57, in resource_timer_handler
result = handler(request)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.5/site-packages/pyramid-1.5.7-py3.5.egg/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.5/site-packages/pyramid_crow/__init__.py", line 13, in crow_tween
request.raven.captureException()
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.5/site-packages/pyramid-1.5.7-py3.5.egg/pyramid/decorator.py", line 37, in __get__
val = self.wrapped(inst)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.5/site-packages/pyramid-1.5.7-py3.5.egg/pyramid/util.py", line 52, in <lambda>
fn = lambda this: callable(this)
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.5/site-packages/pyramid_crow/__init__.py", line 55, in raven_client
client.http_context(_request_to_http_context(request))
File "/home/sealinkd/miniconda/envs/sealinkd/lib/python3.5/site-packages/pyramid_crow/__init__.py", line 26, in _request_to_http_context
if request.content_length < 2**16
TypeError: unorderable types: NoneType() < int()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.