diff --git a/find_duplicate_files/find_duplicate_files.py b/find_duplicate_files/find_duplicate_files.py index 661c30b..6d647b6 100644 --- a/find_duplicate_files/find_duplicate_files.py +++ b/find_duplicate_files/find_duplicate_files.py @@ -64,7 +64,8 @@ class find_duplicate_files: return False def _cache_file(self, file, hash): - result = self.cur.execute(f"INSERT INTO files (hash, file) VALUES ('{file}', '{hash}')") + file_sql = file.replace("'", "\'") + result = self.cur.execute(f"INSERT INTO files (hash, file) VALUES ('{file_sql}', '{hash}')") self.cache_db.commit() return result