diff --git a/api/dao/containerstorage.py b/api/dao/containerstorage.py index 88620c5a35432adae80ccf3c2730fb799bcb1f42..405ef1bec50650720ea9db2b071a6dfb91919e1b 100644 --- a/api/dao/containerstorage.py +++ b/api/dao/containerstorage.py @@ -28,7 +28,7 @@ class ContainerStorage(object): def exec_op(self, action, _id=None, payload=None, query=None, user=None, public=False, projection=None, recursive=False, r_payload=None, - replace_metadata=False): + replace_metadata=False): # pylint: disable=unused-argument """ Generic method to exec an operation. The request is dispatched to the corresponding private methods. diff --git a/api/dao/containerutil.py b/api/dao/containerutil.py index 33619704a4e408eb1588298e7f91ee673615a895..20ac360235311dd1fdb7329b117d5e5a62918417 100644 --- a/api/dao/containerutil.py +++ b/api/dao/containerutil.py @@ -89,6 +89,9 @@ class ContainerReference(object): raise Exception("User " + userID + " does not have " + perm_name + " access to " + self.type + " " + self.id) class FileReference(ContainerReference): + # pylint: disable=redefined-builtin + # TODO: refactor to resolve pylint warning + def __init__(self, type, id, name): super(FileReference, self).__init__(type, id) self.name = name diff --git a/api/download.py b/api/download.py index cb95c64621981da63c6766da46d1de0658c997cf..8a0b0925843e568ab3380c580fa90f61286ef000 100644 --- a/api/download.py +++ b/api/download.py @@ -66,7 +66,8 @@ def archivestream(ticket): for filepath, arcpath, _ in ticket['target']: yield archive.gettarinfo(filepath, arcpath).tobuf() with open(filepath, 'rb') as fd: - for chunk in iter(lambda: fd.read(CHUNKSIZE), ''): + chunk = '' + for chunk in iter(lambda: fd.read(CHUNKSIZE), ''): # pylint: disable=cell-var-from-loop yield chunk if len(chunk) % BLOCKSIZE != 0: yield (BLOCKSIZE - (len(chunk) % BLOCKSIZE)) * b'\0' diff --git a/api/handlers/collectionshandler.py b/api/handlers/collectionshandler.py index a740fca4bd8fe835043574816a804b9ef1e14b54..c265fe057d87a12016267ef54a5881e3030000d9 100644 --- a/api/handlers/collectionshandler.py +++ b/api/handlers/collectionshandler.py @@ -29,7 +29,7 @@ class CollectionsHandler(ContainerHandler): - def post(self, **kwargs): + def post(self): storage = self.container_handler_configurations['collections']['storage'] mongo_validator, payload_validator = self._get_validators() diff --git a/api/handlers/containerhandler.py b/api/handlers/containerhandler.py index 019bcec648a6830a1c6f34cf5c80802919f061ae..346eb9aa06176db2a0bd2faedc77e5e735e435c9 100644 --- a/api/handlers/containerhandler.py +++ b/api/handlers/containerhandler.py @@ -271,8 +271,6 @@ class ContainerHandler(base.RequestHandler): elif self.public_request: permchecker = containerauth.list_public_request else: - # admin_only flag will limit the results to the set on which the user is an admin - admin_only = self.is_true('admin') permchecker = containerauth.list_permission_checker(self) # if par_cont_name (parent container name) and par_id are not null we return only results # within that container diff --git a/api/handlers/schemahandler.py b/api/handlers/schemahandler.py index f672e38b2fd547afd90dfa595e6ad4df0b123611..379c69fa46d8e41a1cac91e1d191dfddd9f99880 100644 --- a/api/handlers/schemahandler.py +++ b/api/handlers/schemahandler.py @@ -14,7 +14,7 @@ class SchemaHandler(base.RequestHandler): def get(self, schema): schema_path = os.path.join(config.get_item('persistent', 'schema_path'), schema) try: - with open(schema_path, 'ru') as f: + with open(schema_path, 'rU') as f: return json.load(f) except IOError as e: self.abort(404, str(e))