NameError in timeit middleware

Bug #1714033 reported by Paul Everitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KARL4
Fix Released
Medium
Jim Fulton

Bug Description

This rarely happens, but presumable in some error condition it gets triggered. I wrote the code so probably made a scoping mistake.

From Theuene:

  return self.app(environ, start_response)
 File "/srv/osfkarl/.buildout/eggs/cp27mu/repoze.vhm-0.14-py2.7.egg/repoze/vhm/middleware.py", line 106, in __call__
   return self.application(environ, start_response)
 File "/srv/osfkarl/.buildout/eggs/cp27mu/repoze.browserid-0.3-py2.7.egg/repoze/browserid/middleware.py", line 134, in __call__
   app_iter = self.app(environ, wrapper.wrap_start_response)
 File "/srv/osfkarl/.buildout/eggs/cp27mu/repoze.urchin-0.2-py2.7.egg/repoze/urchin/__init__.py", line 53, in __call__
   resp = req.get_response(self.app)
 File "/srv/osfkarl/.buildout/eggs/cp27mu/WebOb-1.1.1-py2.7.egg/webob/request.py", line 1086, in get_response
   application, catch_exc_info=False)
 File "/srv/osfkarl/.buildout/eggs/cp27mu/WebOb-1.1.1-py2.7.egg/webob/request.py", line 1055, in call_application
   app_iter = application(self.environ, start_response)
 File "/srv/osfkarl/.buildout/eggs/cp27mu/pyramid-1.2.1-py2.7.egg/pyramid/router.py", line 186, in __call__
   request._process_finished_callbacks()
 File "/srv/osfkarl/.buildout/eggs/cp27mu/pyramid-1.2.1-py2.7.egg/pyramid/request.py", line 284, in _process_finished_callbacks
   callback(self)
 File "/srv/osfkarl/production/109/karl/application.py", line 213, in finished
   elapsed = time.time() - before
NameError: free variable 'before' referenced before assignment in enclosing scope

Revision history for this message
Jim Fulton (jim-zope) wrote :

What machine did Theune see this on? When? Which process?

Revision history for this message
Jim Fulton (jim-zope) wrote :

Having the full traceback would reduce uncertainty. :)

Revision history for this message
Jim Fulton (jim-zope) wrote :

I'll note that looking at the code and at the KARL configs on osfkarl1[01]:

- This is the kind of thing that seems to trip up the Python compiler, and

- Q quick fix *might* be to just move the assignment to ``before`` outside the ``if`` below.

Revision history for this message
Jim Fulton (jim-zope) wrote :

Sorry, I got distracted and left out the middle of that last message:

I'll note that looking at the code and at the KARL configs on osfkarl1[01], it looks like this error shouldn't happen. :)

But:

- This is the kind of thing that seems to trip up the Python compiler, and

- A quick fix *might* be to just move the assignment to ``before`` outside the ``if`` below.

Revision history for this message
Paul Everitt (paul-agendaless) wrote :

I believe this is going out today.

Changed in karl4:
milestone: 034 → 035
status: New → Fix Committed
Changed in karl4:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.