@@ -191,7 +191,7 @@ class Descriptor(object):
191191 _AES_BLOCKSIZE = blobxfer .models .crypto .AES256_BLOCKSIZE_BYTES
192192
193193 def __init__ (self , lpath , ase , options , resume_mgr ):
194- # type: (Descriptior , pathlib.Path,
194+ # type: (Descriptor , pathlib.Path,
195195 # blobxfer.models.azure.StorageEntity,
196196 # blobxfer.models.options.Download,
197197 # blobxfer.operations.resume.DownloadResumeManager) -> None
@@ -321,10 +321,10 @@ def compute_allocated_size(size, is_encrypted):
321321 size //
322322 blobxfer .models .download .Descriptor ._AES_BLOCKSIZE - 1
323323 ) * blobxfer .models .download .Descriptor ._AES_BLOCKSIZE
324+ if allocatesize < 0 :
325+ raise RuntimeError ('allocatesize is negative' )
324326 else :
325327 allocatesize = size
326- if allocatesize < 0 :
327- allocatesize = 0
328328 else :
329329 allocatesize = 0
330330 return allocatesize
@@ -364,10 +364,9 @@ def convert_vectored_io_slice_to_final_path_name(local_path, ase):
364364 :rtype: pathlib.Path
365365 :return: converted final path
366366 """
367- name = local_path .name
368367 name = blobxfer .models .metadata .\
369368 remove_vectored_io_slice_suffix_from_name (
370- name , ase .vectored_io .slice_id )
369+ local_path . name , ase .vectored_io .slice_id )
371370 _tmp = list (local_path .parts [:- 1 ])
372371 _tmp .append (name )
373372 return pathlib .Path (* _tmp )
@@ -460,7 +459,7 @@ def _resume(self):
460459 return None
461460 self ._allocate_disk_space ()
462461 # check if final path exists
463- if not self .final_path .exists ():
462+ if not self .final_path .exists (): # noqa
464463 logger .warning ('download path {} does not exist' .format (
465464 self .final_path ))
466465 return None
@@ -493,7 +492,7 @@ def _resume(self):
493492 if rr .md5hexdigest != hexdigest :
494493 logger .warning (
495494 'MD5 mismatch resume={} computed={} for {}' .format (
496- rr .md5hexdigest , hexdigest , self .final_path ))
495+ rr .md5hexdigest , hexdigest , self .final_path ))
497496 # reset hasher
498497 self .md5 = blobxfer .util .new_md5_hasher ()
499498 return None
@@ -768,12 +767,12 @@ def _restore_file_attributes(self):
768767 if self ._ase .file_attributes is None :
769768 return
770769 # set file uid/gid and mode
771- if blobxfer .util .on_windows ():
770+ if blobxfer .util .on_windows (): # noqa
772771 # TODO not implemented yet
773772 pass
774773 else :
775774 self .final_path .chmod (int (self ._ase .file_attributes .mode , 8 ))
776- if os .getuid () == 0 :
775+ if os .getuid () == 0 : # noqa
777776 os .chown (
778777 str (self .final_path ),
779778 self ._ase .file_attributes .uid ,
0 commit comments