Commit b6172d58 authored by echel0n's avatar echel0n

Fixed startup issue do to unicode decode on os.walk

parent 0beea2be
......@@ -17,8 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
import os
if __name__ == '__main__':
# removes stale .pyc files
for root, dirs, files in os.walk("."):
pyc_files = filter(lambda filename: filename.endswith(".pyc"), files)
py_files = set(filter(lambda filename: filename.endswith(".py"), files))
excess_pyc_files = filter(lambda pyc_filename: pyc_filename[:-1] not in py_files, pyc_files)
for excess_pyc_file in excess_pyc_files:
full_path = os.path.join(root, excess_pyc_file)
os.remove(full_path)
from sickrage import main
main()
......@@ -17,8 +17,19 @@
# You should have received a copy of the GNU General Public License
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
import os
if __name__ == '__main__':
# removes stale .pyc files
for root, dirs, files in os.walk("."):
pyc_files = filter(lambda filename: filename.endswith(".pyc"), files)
py_files = set(filter(lambda filename: filename.endswith(".py"), files))
excess_pyc_files = filter(lambda pyc_filename: pyc_filename[:-1] not in py_files, pyc_files)
for excess_pyc_file in excess_pyc_files:
full_path = os.path.join(root, excess_pyc_file)
os.remove(full_path)
from sickrage import main
main()
# Changelog
- * 376ae9f - 2017-08-27: Added arrow lib to requirements for Trakt API module
- * 564a46f - 2017-08-27: Fixed startup issue do to unicode decode on os.walk
- * 0beea2b - 2017-08-27: Added arrow lib to requirements for Trakt API module
- * 27326ca - 2017-08-27: Moved code to core for removing stale .pyc files
- * 44b1aac - 2017-08-27: Added code to remove old/stale PYC files that could cause potential issues
- * 145cfb8 - 2017-08-27: Fixed issues with syncing Trakt library when we don&#x27;t want to sync Trakt watchlist
......
......@@ -72,6 +72,7 @@ if not (LIBS_DIR in sys.path):
site.addsitedir(LIBS_DIR)
sys.path.extend(remainder)
class Daemon(object):
"""
Usage: subclass the Daemon class
......@@ -225,15 +226,6 @@ def version():
def main():
global srCore, daemon, io_loop, MAIN_DIR, PROG_DIR, DATA_DIR, CACHE_DIR, CONFIG_FILE, PID_FILE, DEVELOPER, DEBUG, DAEMONIZE, WEB_PORT, NOLAUNCH, QUITE
# removes stale .pyc files
for root, dirs, files in os.walk("."):
pyc_files = filter(lambda filename: filename.endswith(".pyc"), files)
py_files = set(filter(lambda filename: filename.endswith(".py"), files))
excess_pyc_files = filter(lambda pyc_filename: pyc_filename[:-1] not in py_files, pyc_files)
for excess_pyc_file in excess_pyc_files:
full_path = os.path.join(root, excess_pyc_file)
os.remove(full_path)
try:
from tornado.ioloop import IOLoop
from sickrage import core
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment