Thriftpy/thriftpy2

AttributeError: '_thread._local' obiect has no attribute 'thrift_stack'

Closed this issue · 3 comments

The #264 PR would change the behaviour of the parser module, it would invoke error AttributeError: '_thread._local' obiect has no attribute 'thrift_stack' when using it with example code:

>>> from thriftpy2.parser.parser import parse
>>> note_thrift = parse("path/to/note. thrift",module_name='abc_thrift', enable_cache=False)
aisk commented

I found that executing only the codes you provided in a sub-thread will cause the exception, because we didn't initialize the thread local in sub-threads. This should be fixed by #267, and we have released an RC version 0.5.1rc1. Can you try to install this version and see if the error is resolved?

We had downgraded to 0.4.20 to fix this issue. I will try the 0.5.1rc1 to reproduce it.
Thanks for the quick responding.

version 0.5.1rc1 fixed my issue