Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GenericRepository: fix unpickling of objects
This allows them to be passed across process boundaries when using `concurrent.futures.ProcessPoolExecutor`. Without this, a `RecursionError` occurs. The issue stems from `GenericRepository.__getattr__` calling `getattr(self.path, ...)`. `GenericRepository.path` is a property, so it is found, but it then calls `self._artifactory.joinpath(...)` and `self._artifactory` is not yet present on the partially-restored `GenericRepository`, resulting in a call to `GenericRepository.__getattr__`, etc. This fix ensures that `self._artifactory` will be restored to the object early enough in unpickling to avoid the issue.
- Loading branch information