diff options
| author | Jan Friedli | 2020-09-03 20:49:04 +0200 |
|---|---|---|
| committer | jfriedli | 2020-09-06 08:29:17 -0700 |
| commit | 493626e1953b0ad79f1298e054c687aff8936aeb (patch) | |
| tree | ecf425c89e15fbe815e8bb60e088a1d7d578f3d6 /matweb/rest_api.py | |
| parent | 3376158b2c9f11d9f66b1d680d6cf5d8b06a9388 (diff) | |
no explicit string casting, changed mat2-web started log message
Diffstat (limited to '')
| -rw-r--r-- | matweb/rest_api.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/matweb/rest_api.py b/matweb/rest_api.py index 1e7f9fd..d3d9d8f 100644 --- a/matweb/rest_api.py +++ b/matweb/rest_api.py | |||
| @@ -31,7 +31,7 @@ class APIUpload(Resource): | |||
| 31 | try: | 31 | try: |
| 32 | file_data = base64.b64decode(args['file']) | 32 | file_data = base64.b64decode(args['file']) |
| 33 | except (binascii.Error, ValueError) as e: | 33 | except (binascii.Error, ValueError) as e: |
| 34 | current_app.logger.error('Upload - Decoding base64 file %s', str(e)) | 34 | current_app.logger.error('Upload - Decoding base64 file %s', e) |
| 35 | abort(400, message='Failed decoding file') | 35 | abort(400, message='Failed decoding file') |
| 36 | 36 | ||
| 37 | file = FileStorage(stream=io.BytesIO(file_data), filename=args['file_name']) | 37 | file = FileStorage(stream=io.BytesIO(file_data), filename=args['file_name']) |
| @@ -169,13 +169,13 @@ class APIBulkDownloadCreator(Resource): | |||
| 169 | cleaned_files_zip.write(complete_path) | 169 | cleaned_files_zip.write(complete_path) |
| 170 | os.remove(complete_path) | 170 | os.remove(complete_path) |
| 171 | except ValueError as e: | 171 | except ValueError as e: |
| 172 | current_app.logger.error('BulkDownload - Creating archive failed: %s', str(e)) | 172 | current_app.logger.error('BulkDownload - Creating archive failed: %s', e) |
| 173 | abort(400, message='Creating the archive failed') | 173 | abort(400, message='Creating the archive failed') |
| 174 | 174 | ||
| 175 | try: | 175 | try: |
| 176 | cleaned_files_zip.testzip() | 176 | cleaned_files_zip.testzip() |
| 177 | except ValueError as e: | 177 | except ValueError as e: |
| 178 | current_app.logger.error('BulkDownload - Validating Zip failed: %s', str(e)) | 178 | current_app.logger.error('BulkDownload - Validating Zip failed: %s', e) |
| 179 | abort(400, message='Validating Zip failed') | 179 | abort(400, message='Validating Zip failed') |
| 180 | 180 | ||
| 181 | parser, mime = utils.get_file_parser(zip_path) | 181 | parser, mime = utils.get_file_parser(zip_path) |
