thriftpy2 icon indicating copy to clipboard operation
thriftpy2 copied to clipboard

Calling `parse_fp()` in v0.5.1 results in "AttributeError: '_thread._local' object has no attribute 'thrift_cache'"

Open rlratzel opened this issue 1 year ago • 5 comments

After installing thriftpy2 0.5.1, the following traceback was encountered when calling parse_fp():

...
 /opt/conda/envs/test/lib/python3.9/site-packages/cugraph_service_client/cugraph_service_thrift.py:262: in <module>
    spec = thriftpy2.load_fp(io.StringIO(cugraph_thrift_spec), module_name="cugraph_thrift")
/opt/conda/envs/test/lib/python3.9/site-packages/thriftpy2/parser/__init__.py:171: in load_fp
    thrift = parse_fp(source, module_name)
/opt/conda/envs/test/lib/python3.9/site-packages/thriftpy2/parser/parser.py:628: in parse_fp
    if enable_cache and module_name in threadlocal.thrift_cache:
E   AttributeError: '_thread._local' object has no attribute 'thrift_cache'

Perhaps the change to parse() done in this PR should also be applied to parse_fp()?

rlratzel avatar Jun 26 '24 03:06 rlratzel

Yes, it's my fault, I thought parse is using parse_fp under the hood, but it's not.

aisk avatar Jun 26 '24 15:06 aisk

Released a beta version v0.5.2b1 which contains the fix.

aisk avatar Jun 28 '24 08:06 aisk

Bitten by the same bug, Pls yank version v0.5.0 and v0.5.1.

Appreciated!

tyong920 avatar Jul 04 '24 03:07 tyong920

I released v0.5.2b2 which also contains a bugfix that some user needs in a hurry. I will release v0.5.2 tomorrow if no one report bug about it. I notified some users to test the v0.5.2b2.

Yank v0.5.0 and v0.5.1 is not a good choice because I see some user are already using it and pined the version to 0.5.

aisk avatar Jul 04 '24 16:07 aisk

v0.5.2 just released.

aisk avatar Jul 05 '24 12:07 aisk