Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
truebit opened this issue May 14, 2024 · 3 comments · Fixed by #267
Closed

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

truebit opened this issue May 14, 2024 · 3 comments · Fixed by #267

Comments

@truebit
Copy link
Contributor

truebit commented May 14, 2024

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
Copy link
Member

aisk commented May 14, 2024

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?

@aisk aisk reopened this May 14, 2024
@truebit
Copy link
Contributor Author

truebit commented May 15, 2024

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.

@truebit
Copy link
Contributor Author

truebit commented May 15, 2024

version 0.5.1rc1 fixed my issue

@truebit truebit closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants