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

Error while calling SPDX parse_file() API inside thread function #801

Open
Noufalp90 opened this issue Mar 21, 2024 · 0 comments
Open

Error while calling SPDX parse_file() API inside thread function #801

Noufalp90 opened this issue Mar 21, 2024 · 0 comments

Comments

@Noufalp90
Copy link

Noufalp90 commented Mar 21, 2024

I have an application where am using multi threading approach for parsing SPDX file. While using parse_file() function defined at "src/spdx_tools/spdx/parser/parse_anything.py" inside my thread function, sometimes I am running into following error.

doc = parse_anything.parse_file(dir+"/"+file)
File "/lib/python3.8/site-packages/spdx_tools/spdx/parser/parse_anything.py", line 32, in parse_file
return tagvalue_parser.parse_from_file(file_name, encoding)
File "/lib/python3.8/site-packages/spdx_tools/spdx/parser/tagvalue/tagvalue_parser.py", line 9, in parse_from_file
parser = Parser()
File "/lib/python3.8/site-packages/spdx_tools/spdx/parser/tagvalue/parser.py", line 94, in __init__
self.yacc = yacc.yacc(module=self, **kwargs)
File "/lib/python3.8/site-packages/ply/yacc.py", line 3293, in yacc
read_signature = lr.read_table(tabmodule)
File "/lib/python3.8/site-packages/ply/yacc.py", line 1987, in read_table
if parsetab._tabversion != __tabversion__:
AttributeError: module 'spdx_tools.spdx.parser.tagvalue.parsetab' has no attribute '_tabversion'``

But when I am not using multi thread concept, not observed any issue with the function.
Does this function is thread-safe?
Can someone help me to guide how can I resolve this issue.

Thanks
Noufal

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

No branches or pull requests

1 participant