Runtime Imports cause thread deadlock

Issue #821 resolved
legonigel
created an issue

Inside workbook.py there are some runtime imports in the _setup_styles(self) method.

When this method is run from a second thread it can in some cases cause deadlock due to the import lock. If these imports are done at import time, this issue should go away.

It looks to me that these imports are in the function to control the scope of the imports. An alternative might be to use from ... import ... as ... and maybe use and _name to control the import.

Comments (2)

  1. Charlie Clark

    Thanks for the report. I think that these particular imports could probably be moved out of that method but there are other parts of the project where this trick is required to avoid circular imports. I'm also pretty certain that the library isn't thread-safe for other reasons but I would like to try and fix that in the future.

  2. Log in to comment