Use a less intrusive workaround for the Linux kernel bug causing Kindle disconnects

This commit is contained in:
Kovid Goyal 2019-07-04 11:01:50 +05:30
parent f27b3d7c28
commit 7f978f859c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -674,9 +674,7 @@ def fsync(fileobj):
# python -c "p = '/run/media/kovid/Kindle/driveinfo.calibre'; f = open(p, 'r+b'); os.fsync(f.fileno());"
# this will cause the Kindle to disconnect.
try:
with open(fileobj.name + '.linux-sucks', 'wb') as f:
f.write(b'I cannot believe I need to do this')
os.remove(f.name)
os.utime(fileobj.name, None)
except Exception:
import traceback
traceback.print_exc()