New submission from jkarp <johnk...@gmail.com>:

When repoze.profile is given an application to wrap that takes the form of a
generator, you end up with a useless profile that has only the entries
"<string>:1(<module>)" and "{method 'disable' of '_lsprof.Profiler' objects}".

This is because the way the profiling is being invoked, it only includes the
assignment of a generator object to app_iter. For the application code to be
executed, the generator must be iterated over, and that isn't happening until
after profiling has stopped.

One band-aid solution might be to change repoze.profile to profile
'list(self.app(environ, start_response))' instead of 'self.app(environ,
start_response)'.

----------
messages: 456
nosy: jkarp
priority: bug
status: unread
title: repoze.profile: useless profile recorded when application is a generator

__________________________________
Repoze Bugs <b...@bugs.repoze.org>
<http://bugs.repoze.org/issue169>
__________________________________
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to