summary refs log tree commit diff
path: root/synapse/rest/media
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2017-10-23 15:52:32 +0100
committerRichard van der Hoff <richard@matrix.org>2017-10-23 15:52:32 +0100
commiteaaabc6c4f93d49f090ef7ff930fa2739428a36f (patch)
treef5e5f3565589bc31d3dc9580608148b9d2f03a7c /synapse/rest/media
parentMerge pull request #2566 from matrix-org/rav/media_logcontext_leak (diff)
downloadsynapse-eaaabc6c4f93d49f090ef7ff930fa2739428a36f.tar.xz
replace 'except:' with 'except Exception:'
what could possibly go wrong
Diffstat (limited to 'synapse/rest/media')
-rw-r--r--synapse/rest/media/v1/_base.py2
-rw-r--r--synapse/rest/media/v1/media_repository.py2
-rw-r--r--synapse/rest/media/v1/preview_url_resource.py6
3 files changed, 5 insertions, 5 deletions
diff --git a/synapse/rest/media/v1/_base.py b/synapse/rest/media/v1/_base.py
index bce077becf..95fa95fce3 100644
--- a/synapse/rest/media/v1/_base.py
+++ b/synapse/rest/media/v1/_base.py
@@ -45,7 +45,7 @@ def parse_media_id(request):
             except UnicodeDecodeError:
                 pass
         return server_name, media_id, file_name
-    except:
+    except Exception:
         raise SynapseError(
             404,
             "Invalid media id token %r" % (request.postpath,),
diff --git a/synapse/rest/media/v1/media_repository.py b/synapse/rest/media/v1/media_repository.py
index 6b50b45b1f..eed9056a2f 100644
--- a/synapse/rest/media/v1/media_repository.py
+++ b/synapse/rest/media/v1/media_repository.py
@@ -310,7 +310,7 @@ class MediaRepository(object):
                 media_length=length,
                 filesystem_id=file_id,
             )
-        except:
+        except Exception:
             os.remove(fname)
             raise
 
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py
index 2a3e37fdf4..80114fca0d 100644
--- a/synapse/rest/media/v1/preview_url_resource.py
+++ b/synapse/rest/media/v1/preview_url_resource.py
@@ -367,7 +367,7 @@ class PreviewUrlResource(Resource):
                 dirs = self.filepaths.url_cache_filepath_dirs_to_delete(media_id)
                 for dir in dirs:
                     os.rmdir(dir)
-            except:
+            except Exception:
                 pass
 
         yield self.store.delete_url_cache(removed_media)
@@ -397,7 +397,7 @@ class PreviewUrlResource(Resource):
                 dirs = self.filepaths.url_cache_filepath_dirs_to_delete(media_id)
                 for dir in dirs:
                     os.rmdir(dir)
-            except:
+            except Exception:
                 pass
 
             thumbnail_dir = self.filepaths.url_cache_thumbnail_directory(media_id)
@@ -415,7 +415,7 @@ class PreviewUrlResource(Resource):
                 dirs = self.filepaths.url_cache_thumbnail_dirs_to_delete(media_id)
                 for dir in dirs:
                     os.rmdir(dir)
-            except:
+            except Exception:
                 pass
 
         yield self.store.delete_url_cache_media(removed_media)