Fix full sync on Windows
From <https://docs.python.org/3.7/library/os.html#os.rename>: > On Windows, if dst already exists, OSError will be raised even if > it is a file. ... > If you want cross-platform overwriting of the destination, use > replace(). Thanks to kerry liu (https://github.com/hqzxjczx) for reporting this. Fixes #32.
This commit is contained in:
		
							parent
							
								
									b9a1203491
								
							
						
					
					
						commit
						7ef3d4f3fa
					
				@ -25,7 +25,7 @@ class FullSyncManager:
 | 
				
			|||||||
        # Overwrite existing db.
 | 
					        # Overwrite existing db.
 | 
				
			||||||
        col.close()
 | 
					        col.close()
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            os.rename(temp_db_path, session.get_collection_path())
 | 
					            os.replace(temp_db_path, session.get_collection_path())
 | 
				
			||||||
        finally:
 | 
					        finally:
 | 
				
			||||||
            col.reopen()
 | 
					            col.reopen()
 | 
				
			||||||
            col.load()
 | 
					            col.load()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user