diff --git a/bin/autojump_data.py b/bin/autojump_data.py index 3ce96c2..b3e9e5a 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():