Fix to correctly load local libraries instead of system installed libraries

This fix correctly places the local libraries at the start of the sys.path such that they are loaded instead of any libraries that may already exist on the users system. This prevents the issue where a system library that isn't supported by SickGear is loaded and causes errors during operation.
This commit is contained in:
Adam 2015-06-04 21:36:38 +08:00
parent 0ed990d369
commit e06e671d67
14 changed files with 21 additions and 20 deletions

View file

@ -18,6 +18,7 @@
* Fix getManualSearchStatus: object has no attribute 'segment'
* Change handling of general HTTP error response codes to prevent issues
* Add handling for CloudFlare custom HTTP response codes
* Fix to correctly load local libraries instead of system installed libraries
### 0.9.1 (2015-05-25 03:03:00 UTC)

View file

@ -47,7 +47,7 @@ except:
print 'The Python module Cheetah is required'
sys.exit(1)
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib')))
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib')))
# We only need this for compiling an EXE and I will just always do that on 2.6+
if sys.hexversion >= 0x020600F0:

View file

@ -24,8 +24,8 @@ import os.path
import sys
sickbeardPath = os.path.split(os.path.split(sys.argv[0])[0])[0]
sys.path.append(os.path.join(sickbeardPath, 'lib'))
sys.path.append(sickbeardPath)
sys.path.insert(1, os.path.join(sickbeardPath, 'lib'))
sys.path.insert(1, sickbeardPath)
try:
import requests

View file

@ -6,8 +6,8 @@ import ConfigParser
import logging
sickbeardPath = os.path.split(os.path.split(sys.argv[0])[0])[0]
sys.path.append(os.path.join(sickbeardPath, 'lib'))
sys.path.append(sickbeardPath)
sys.path.insert(1, os.path.join(sickbeardPath, 'lib'))
sys.path.insert(1, sickbeardPath)
configFilename = os.path.join(sickbeardPath, 'config.ini')
try:

View file

@ -17,7 +17,7 @@ import unittest
# Force parent directory onto path
#sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(os.path.abspath('../../tests'))
sys.path.insert(1, os.path.abspath('../../tests'))
import sickbeard

View file

@ -32,7 +32,7 @@ import os.path
import uuid
import base64
import sickbeard
sys.path.append(os.path.abspath('../lib'))
sys.path.insert(1, os.path.abspath('../lib'))
from sickbeard import providers, metadata, config, webserveInit
from sickbeard.providers.generic import GenericProvider
from providers import btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, \

View file

@ -2,7 +2,7 @@ import unittest
import sys
import os.path
sys.path.append(os.path.abspath('..'))
sys.path.insert(1, os.path.abspath('..'))
from sickbeard import common

View file

@ -5,7 +5,7 @@ import os.path
from sickbeard import helpers
sys.path.append(os.path.abspath('..'))
sys.path.insert(1, os.path.abspath('..'))
class HelpersTests(unittest.TestCase):

View file

@ -7,8 +7,8 @@ import sickbeard
from time import sleep
from sickbeard import db
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('../lib'))
sys.path.insert(1, os.path.abspath('..'))
sys.path.insert(1, os.path.abspath('../lib'))
sickbeard.SYS_ENCODING = 'UTF-8'

View file

@ -4,8 +4,8 @@ import test_lib as test
import sys, os.path
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('../lib'))
sys.path.insert(1, os.path.abspath('..'))
sys.path.insert(1, os.path.abspath('../lib'))
from sickbeard.name_parser import parser

View file

@ -2,7 +2,7 @@ import unittest
import test_lib as test
import sys, os.path
sys.path.append(os.path.abspath('..'))
sys.path.insert(1, os.path.abspath('..'))
from sickbeard import show_name_helpers, scene_exceptions, common, name_cache

View file

@ -25,8 +25,8 @@ import glob
import sys
import os.path
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('../lib'))
sys.path.insert(1, os.path.abspath('..'))
sys.path.insert(1, os.path.abspath('../lib'))
import sickbeard
import shutil

View file

@ -23,8 +23,8 @@ import unittest
import sys, os.path
import urlparse
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('../lib'))
sys.path.insert(1, os.path.abspath('..'))
sys.path.insert(1, os.path.abspath('../lib'))
import test_lib as test
from bs4 import BeautifulSoup

View file

@ -24,8 +24,8 @@ import sys, os.path
import datetime
import re
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('../lib'))
sys.path.insert(1, os.path.abspath('..'))
sys.path.insert(1, os.path.abspath('../lib'))
import test_lib as test
import sickbeard