mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
...
This commit is contained in:
parent
4036e4af7d
commit
3d51b47f57
@ -11,6 +11,7 @@ from io import DEFAULT_BUFFER_SIZE
|
|||||||
from select import select
|
from select import select
|
||||||
|
|
||||||
from calibre.constants import iswindows, isosx
|
from calibre.constants import iswindows, isosx
|
||||||
|
from calibre.utils.ipc import eintr_retry_call
|
||||||
|
|
||||||
def file_metadata(fileobj):
|
def file_metadata(fileobj):
|
||||||
try:
|
try:
|
||||||
@ -23,7 +24,7 @@ def copy_range(src_file, start, size, dest):
|
|||||||
total_sent = 0
|
total_sent = 0
|
||||||
src_file.seek(start)
|
src_file.seek(start)
|
||||||
while size > 0:
|
while size > 0:
|
||||||
data = src_file.read(min(size, DEFAULT_BUFFER_SIZE))
|
data = eintr_retry_call(src_file.read, min(size, DEFAULT_BUFFER_SIZE))
|
||||||
if len(data) == 0:
|
if len(data) == 0:
|
||||||
break # EOF
|
break # EOF
|
||||||
dest.write(data)
|
dest.write(data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user