reidfaiv <reid.f...@null.net> added the comment:
I will withdraw this bug report. I am unable to isolate that issue, hence I can
not confirm if this is purely Python crash or caused by some extension. It
looks memory corruption to me as segfault moves around and produces different
New submission from reidfaiv:
We have one application misbehaving in production environment under the load:
it segfaults occasionally and throws exception which does not seem to make
sense. We have tested both on 3.4 and 3.5.
For a background - we have taken a bit unusual path - as server
reidfaiv added the comment:
def __exit__(self, type_, value, tb):
print('__exit__') # print() is also built-in, but works
print(sorted(builtins.__dict__.keys()))
f = open('test.log', 'wt') # <-- NameError: name 'open' is not defined
f.close()
reidfaiv added the comment:
Indeed, explicitly closing generator helps, following works:
def run(**kwargs):
g = event_gen(**kwargs)
r = next(g)
g.close()
r()
Thanks!
Do you want to keep this issue open for investigation
New submission from reidfaiv:
Builtin open() gets NameError) in context manager __exit__ in case:
* context manager yielding records
* we return another generator when consuming these and
* second generator raises, catches, stores and re-raises an excption
Reduced down code looks like