aboutsummaryrefslogtreecommitdiff
path: root/cli/onionshare_cli/web/receive_mode.py
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2021-04-29 17:13:05 -0700
committerMicah Lee <micah@micahflee.com>2021-04-29 17:13:05 -0700
commit0a6056e5e6d6e29c2c2bd412ecf02ee9a2a4a8de (patch)
tree5e79b2ccf784db41748b82129bd4d9658f61a8a9 /cli/onionshare_cli/web/receive_mode.py
parent343e1be3d08e0725815e1a2d6bf7c4717c8c26b5 (diff)
downloadonionshare-0a6056e5e6d6e29c2c2bd412ecf02ee9a2a4a8de.tar.gz
onionshare-0a6056e5e6d6e29c2c2bd412ecf02ee9a2a4a8de.zip
Fix flake8 issues found in cli
Diffstat (limited to 'cli/onionshare_cli/web/receive_mode.py')
-rw-r--r--cli/onionshare_cli/web/receive_mode.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/cli/onionshare_cli/web/receive_mode.py b/cli/onionshare_cli/web/receive_mode.py
index c3729a0f..ddc5a51b 100644
--- a/cli/onionshare_cli/web/receive_mode.py
+++ b/cli/onionshare_cli/web/receive_mode.py
@@ -33,8 +33,6 @@ uploads files:
- new ReceiveModeRequest object is created
- creates a directory based on the timestamp
--
-
"""
@@ -303,7 +301,7 @@ class ReceiveModeFile(object):
self.upload_error = False
try:
self.f = open(self.filename_in_progress, "wb+")
- except:
+ except Exception:
# This will only happen if someone is messing with the data dir while
# OnionShare is running, but if it does make sure to throw an error
self.upload_error = True
@@ -351,7 +349,7 @@ class ReceiveModeFile(object):
bytes_written = self.f.write(b)
self.onionshare_write_func(self.onionshare_filename, bytes_written)
- except:
+ except Exception:
self.upload_error = True
def close(self):
@@ -365,7 +363,7 @@ class ReceiveModeFile(object):
# Rename the in progress file to the final filename
os.rename(self.filename_in_progress, self.filename)
- except:
+ except Exception:
self.upload_error = True
self.onionshare_close_func(self.onionshare_filename, self.upload_error)
@@ -465,7 +463,7 @@ class ReceiveModeRequest(Request):
# Figure out the content length
try:
self.content_length = int(self.headers["Content-Length"])
- except:
+ except Exception:
self.content_length = 0
date_str = datetime.now().strftime("%b %d, %I:%M%p")