diff --git a/cps/helper.py b/cps/helper.py index 3b0c2a04..4dabcfce 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -738,16 +738,18 @@ def save_cover_from_url(url, book_path): return save_cover(img, book_path) except (socket.gaierror, requests.exceptions.HTTPError, + requests.exceptions.InvalidURL, requests.exceptions.ConnectionError, requests.exceptions.Timeout) as ex: - log.info(u'Cover Download Error %s', ex) + # "Invalid host" can be the result of a redirect response + log.error(u'Cover Download Error %s', ex) return False, _("Error Downloading Cover") except MissingDelegateError as ex: log.info(u'File Format Error %s', ex) return False, _("Cover Format Error") - except UnacceptableAddressException: - log.error("Localhost was accessed for cover upload") - return False, _("You are not allowed to access localhost for cover uploads") + except UnacceptableAddressException as e: + log.error("Localhost or local network was accessed for cover upload") + return False, _("You are not allowed to access localhost or the local network for cover uploads") def save_cover_from_filestorage(filepath, saved_filename, img): diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index b2de4c81..e3b7a3d7 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
Start Time: 2022-03-13 21:32:38
+Start Time: 2022-03-14 21:13:33
Stop Time: 2022-03-14 02:20:13
+Stop Time: 2022-03-15 02:05:20
Duration: 3h 59 min
+Duration: 4h 3 min
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_cover_edit_books.py", line 56, in test_upload_jpg - self.assertTrue("Error Downloading Cover" in self.check_element_on_page((By.ID, "flash_danger")).text) -AssertionError: False is not true-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_kepubify_gdrive.py", line 213, in test_convert_only - self.assertEqual(ret[-1]['result'], 'Finished') -AssertionError: 'Failed' != 'Finished' -- Failed -+ Finished-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 402, in test_edit_author - self.fill_basic_config({"config_unicode_filename": 0}) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 358, in fill_basic_config - cls._fill_basic_config(elements) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 268, in _fill_basic_config - WebDriverWait(cls.driver, 5).until(EC.presence_of_element_located((By.ID, "config_port"))) - File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.8/site-packages/selenium/webdriver/support/wait.py", line 89, in until - raise TimeoutException(message, screen, stacktrace) -selenium.common.exceptions.TimeoutException: Message: -Stacktrace: -WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5 -NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:395:5 -element.find/</<@chrome://remote/content/marionette/element.js:300:16-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 868, in test_upload_book_epub + File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 853, in test_upload_book_epub self.assertEqual('8936', resp.headers['Content-Length']) AssertionError: '8936' != '1103' - 8936 @@ -1873,7 +1801,7 @@ AssertionError: '8936' != '1103'
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 781, in test_upload_cover_hdd + File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 766, in test_upload_cover_hdd self.assertGreater(diff('original.png', 'jpeg.png', delete_diff_file=True), 0.02) AssertionError: 0.0 not greater than 0.02
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 950, in test_watch_metadata + File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 935, in test_watch_metadata self.assertNotIn('series', book) -AssertionError: 'series' unexpectedly found in {'id': 5, 'reader': [], 'title': 'testbook', 'author': ['John Döe'], 'rating': 0, 'languages': ['English'], 'identifier': [], 'cover': '/cover/5?edit=f66a16a8-b9e1-446d-b1ad-21b11df67753', 'tag': [], 'publisher': ['Randomhäus'], 'pubdate': 'Jan 19, 2017', 'comment': 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.Aenean commodo ligula eget dolor.Aenean massa.Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.Nulla consequat massa quis enim.Donec pede justo, fringilla vel, aliquet nec, vulputate', 'add_shelf': [], 'del_shelf': [], 'edit_enable': True, 'kindle': None, 'kindlebtn': None, 'download': ['EPUB (6.7 kB)'], 'read': False, 'archived': False, 'series_all': 'Book 1 of test', 'series_index': '1', 'series': 'test', 'cust_columns': []}+AssertionError: 'series' unexpectedly found in {'id': 5, 'reader': [], 'title': 'testbook', 'author': ['John Döe'], 'rating': 0, 'languages': ['English'], 'identifier': [], 'cover': '/cover/5?edit=2e081d1c-86d2-461f-a309-e51e1e378161', 'tag': [], 'publisher': ['Randomhäus'], 'pubdate': 'Jan 19, 2017', 'comment': 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.Aenean commodo ligula eget dolor.Aenean massa.Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.Nulla consequat massa quis enim.Donec pede justo, fringilla vel, aliquet nec, vulputate', 'add_shelf': [], 'del_shelf': [], 'edit_enable': True, 'kindle': None, 'kindlebtn': None, 'download': ['EPUB (6.7 kB)'], 'read': False, 'archived': False, 'series_all': 'Book 1 of test', 'series_index': '1', 'series': 'test', 'cust_columns': []}
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_opds_feed.py", line 60, in test_opds - self.assertEqual(200, r.status_code) -AssertionError: 200 != 500-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_opds_feed.py", line 339, in test_opds_author - entries = self.get_opds_feed(r.text) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1159, in get_opds_feed - ret['len'] = key -UnboundLocalError: local variable 'key' referenced before assignment-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_opds_feed.py", line 100, in test_opds_guest_user - self.assertEqual(200, r.status_code) -AssertionError: 200 != 500-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_opds_feed.py", line 375, in test_opds_non_admin - self.assertEqual(401, r.status_code) -AssertionError: 401 != 200-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_opds_feed.py", line 286, in test_opds_publisher - entries = self.get_opds_feed(r.text) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1159, in get_opds_feed - ret['len'] = key -UnboundLocalError: local variable 'key' referenced before assignment-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_opds_feed.py", line 435, in test_opds_ratings - entries = self.get_opds_feed(r.text) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1159, in get_opds_feed - ret['len'] = key -UnboundLocalError: local variable 'key' referenced before assignment-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_opds_feed.py", line 563, in test_opds_search - self.assertEqual(401, r.status_code) -AssertionError: 401 != 200-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_opds_feed.py", line 260, in test_opds_series - entries = self.get_opds_feed(r.text) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1159, in get_opds_feed - ret['len'] = key -UnboundLocalError: local variable 'key' referenced before assignment-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_opds_feed.py", line 297, in test_opds_tags - entries = self.get_opds_feed(r.text) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1159, in get_opds_feed - ret['len'] = key -UnboundLocalError: local variable 'key' referenced before assignment-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_opds_feed.py", line 33, in tearDownClass - cls.stop_calibre_web() - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 446, in stop_calibre_web - cls.driver.find_element(By.ID, 'admin_stop').click() - File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 1248, in find_element - return self.execute(Command.FIND_ELEMENT, { - File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 425, in execute - self.error_handler.check_response(response) - File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response - raise exception_class(message, screen, stacktrace) -selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [id="admin_stop"] -Stacktrace: -WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5 -NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:395:5 -element.find/</<@chrome://remote/content/marionette/element.js:300:16-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_shelf.py", line 530, in test_adv_search_shelf - self.assertEqual(len(self.adv_search({u'include_shelf': u'Search', 'include_tag': 'Gênot'})), 2) -AssertionError: 3 != 2-