Message288546
giampaolo: it seems that contextmanager will somehow make a bad return in `trace_dispatch_return`:
$ ./python tests.py
# logging.fatal('%r %r' % (frame.f_code.co_name, self.cur[-3]))
CRITICAL:root:'runblock' '' ('profile', 0, '')
CRITICAL:root:'__enter__' '' ('profile', 0, '')
Traceback (most recent call last):
File "tests.py", line 18, in <module>
with p.runblock():
File "/home/grd/Python/cpython/Lib/contextlib.py", line 82, in __enter__
return next(self.gen)
File "/home/grd/Python/cpython/Lib/profile.py", line 256, in trace_dispatch_i
if self.dispatch[event](self, frame, t):
File "/home/grd/Python/cpython/Lib/profile.py", line 346, in trace_dispatch_return
raise AssertionError("Bad return", self.cur[-3])
AssertionError: ('Bad return', ('profile', 0, ''))
I make a workaround in GitHub PR, that skip the assert when self.cur[-3] is ('profile', 0, ''), and this work fine with your test cases.
p.s. I'm not very sure about the assertion of bad return, maybe this workaround may cause some side affact I didn't notice. |
|
Date |
User |
Action |
Args |
2017-02-25 07:35:23 | louielu | set | recipients:
+ louielu, tim.peters, fdrake, arigo, georg.brandl, rhettinger, nbastin, pitrou, giampaolo.rodola, benjamin.peterson, ezio.melotti, eric.araujo, tleeuwenburg@gmail.com, debatem1, ubershmekel, bjorns |
2017-02-25 07:35:22 | louielu | set | messageid: <1488008122.98.0.820957128131.issue9285@psf.upfronthosting.co.za> |
2017-02-25 07:35:22 | louielu | link | issue9285 messages |
2017-02-25 07:35:22 | louielu | create | |
|