From 05652beef1172b58f98624c8ea34d52d4f881c12 Mon Sep 17 00:00:00 2001 From: evilhero Date: Mon, 13 Jan 2020 16:33:15 -0500 Subject: [PATCH] removed python2.7.9 reference on configuration page, fixed nzbget binary error, added configuration location to logging initialization, fix some unicode errors --- data/interfaces/default/config.html | 3 --- mylar/filechecker.py | 4 ++-- mylar/mb.py | 2 +- mylar/nzbget.py | 8 +++++--- mylar/webserve.py | 3 +-- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 7b78249e..43174a70 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -828,9 +828,6 @@ -->
-
- python 2.7.9 required for 32P usage -
diff --git a/mylar/filechecker.py b/mylar/filechecker.py index a365c35f..ecebb57c 100755 --- a/mylar/filechecker.py +++ b/mylar/filechecker.py @@ -1770,8 +1770,8 @@ def setperms(path, dir=False): logger.fdebug('Successfully changed permissions [' + str(mylar.CONFIG.CHMOD_DIR) + ' / ' + str(mylar.CONFIG.CHMOD_FILE) + ']') - except OSError: - logger.error('Could not change permissions : %s. Exiting...' % path) + except OSError as e: + logger.error('[ERROR @ path: %s] %s. Exiting...' % (path, e)) return diff --git a/mylar/mb.py b/mylar/mb.py index 67d9f2de..c705304a 100755 --- a/mylar/mb.py +++ b/mylar/mb.py @@ -78,7 +78,7 @@ def pullsearch(comicapi, comicquery, offset, type): try: dom = parseString(r.content) #(data) except ExpatError: - if 'Abnormal Traffic Detected' in r.content: + if 'Abnormal Traffic Detected' in r.content.decode('utf-8'): logger.error('ComicVine has banned this server\'s IP address because it exceeded the API rate limit.') else: logger.warn('[WARNING] ComicVine is not responding correctly at the moment. This is usually due to some problems on their end. If you re-try things again in a few moments, it might work properly.') diff --git a/mylar/nzbget.py b/mylar/nzbget.py index e19ea6ff..06dbc416 100644 --- a/mylar/nzbget.py +++ b/mylar/nzbget.py @@ -66,9 +66,11 @@ class NZBGet(object): nzbgetpriority = 0 - in_file = open(filename, 'r') - nzbcontent = in_file.read() - in_file.close() + with open(filename, 'rb') as in_file: + while True: + nzbcontent = in_file.read(4096) + if not chunk: + break nzbcontent64 = standard_b64encode(nzbcontent) try: logger.fdebug('sending now to %s' % self.nzb_url) diff --git a/mylar/webserve.py b/mylar/webserve.py index 18050d4a..0b5ae8c9 100644 --- a/mylar/webserve.py +++ b/mylar/webserve.py @@ -1,5 +1,4 @@ # This file is part of Mylar. -# -*- coding: utf-8 -*- # # Mylar is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -4018,7 +4017,7 @@ class WebInterface(object): logger.debug("If you can read this message, debug logging is now working") else: logger.info("normal (INFO) logging is now enabled") - + logger.info('config file has been loaded from: %s' % mylar.CONFIG_FILE) raise cherrypy.HTTPRedirect("logs") toggleVerbose.exposed = True