From 7f978f859c9f415c1bd5640df07c729b73b9806f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 4 Jul 2019 11:01:50 +0530 Subject: [PATCH] Use a less intrusive workaround for the Linux kernel bug causing Kindle disconnects --- src/calibre/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index a522695435..f2c2c8d2ee 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -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()