diff --git a/tiktok_hashtag_analysis/cli.py b/tiktok_hashtag_analysis/cli.py index 37141d5..b2583cd 100644 --- a/tiktok_hashtag_analysis/cli.py +++ b/tiktok_hashtag_analysis/cli.py @@ -99,6 +99,11 @@ def process_output_dir( if not os.access(path=_output_dir, mode=os.W_OK): parser.error(error_message(_output_dir)) else: + # On Windows, os.access is unreliable + temp_file = _output_dir / "test.txt" + with open(temp_file, 'w') as f: + f.write("test") + os.remove(temp_file) return _output_dir except PermissionError: parser.error(error_message(_output_dir))