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

Racecondition when downloading color definition files #702

Open
sirno opened this issue Aug 22, 2023 · 0 comments
Open

Racecondition when downloading color definition files #702

sirno opened this issue Aug 22, 2023 · 0 comments

Comments

@sirno
Copy link

sirno commented Aug 22, 2023

Hi,

the following code introduces a racecondition that may trigger when multiple instances of python import ete4 in parallel

taxid2color_file = ETE_DATA_HOME + '/taxid2color.json'
if not os.path.exists(taxid2color_file):
url = ('https://github.com/etetoolkit/ete-data/raw/main'
'/layouts/taxid2color.json')
update_ete_data(taxid2color_file, url)
with open(taxid2color_file) as handle:
_taxid2color = json.load(handle)

Similar raceconditions apply for smart2color.json and pfam2color.json.

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