diff --git a/bin/autojump_data.py b/bin/autojump_data.py index da86c90..e3067bd 100644 --- a/bin/autojump_data.py +++ b/bin/autojump_data.py @@ -121,6 +121,8 @@ def save(config, data): try: # write to temp file temp = NamedTemporaryFile(delete=False) + # prevent Windows errors by closing the file before opening it. + temp.close() with open(temp.name, 'w', encoding='utf-8', errors='replace') as f: for path, weight in data.items():