progressbar.next()
while left > 0:
length = min(left, blocksize)
- _, sent = sendfile(dst.fileno(), src.fileno(), offset,
- length)
+ sent = sendfile(dst.fileno(), src.fileno(), offset, length)
+
+ # Workaround for python-sendfile API change. In
+ # python-sendfile 1.2.x (py-sendfile) the returning value
+ # of sendfile is a tuple, where in version 2.x (pysendfile)
+ # it is just a sigle integer.
+ if isinstance(sent, tuple):
+ sent = sent[1]
+
offset += sent
left -= sent
progressbar.goto((size - left) // MB)
license='BSD',
packages=find_packages(),
include_package_data=True,
- install_requires=['sh', 'ansicolors', 'progress>=1.0.2', 'py-sendfile'],
+ install_requires=['sh', 'ansicolors', 'progress>=1.0.2'],
entry_points={
'console_scripts': [
'snf-image-creator = image_creator.main:main',