Don't do fsync on unix

This commit is contained in:
Markus Unterwaditzer 2015-02-22 14:54:03 +01:00
parent a1a9cfef80
commit 6541b5b4af

View file

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import sys
import threading import threading
import requests import requests
@ -279,7 +280,8 @@ def get_etag_from_fileobject(f):
doesn't change its mtime. doesn't change its mtime.
''' '''
f.flush() # Only this is necessary on Linux f.flush() # Only this is necessary on Linux
os.fsync(f.fileno()) # Apparently necessary on Windows if sys.platform == 'win32':
os.fsync(f.fileno()) # Apparently necessary on Windows
return get_etag_from_file(f.name) return get_etag_from_file(f.name)