From c5c34d8a9640e8c9725119541cd9e50903a162a5 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 7 Nov 2018 17:09:08 +0000 Subject: [PATCH] Changing cache file rigths to 666 so that different users on the same machine could use it concurrently. Otherwise it fails at initialization and cache is not used so there is no inicialization gains in the case of two users running the library in the same machine. --- jieba/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jieba/__init__.py b/jieba/__init__.py index ef65cf57..4c585dc3 100644 --- a/jieba/__init__.py +++ b/jieba/__init__.py @@ -152,6 +152,7 @@ def initialize(self, dictionary=None): with os.fdopen(fd, 'wb') as temp_cache_file: marshal.dump( (self.FREQ, self.total), temp_cache_file) + os.chmod(fpath, 0o666) _replace_file(fpath, cache_file) except Exception: default_logger.exception("Dump cache file failed.")