[Core/Downloader] Add 3rd-party lib folder to sys.path before loading cogs (#3062)

* fix(core,downloader): add lib folder to sys.path before loading cogs

* chore(changelog): add towncrier entry

* fix(core): always append 3rd-party lib path to the end of `sys.path`
This commit is contained in:
jack1142
2019-10-22 04:43:00 +02:00
committed by Michael H
parent 8267ad9aab
commit 3b0fa0c05d
4 changed files with 9 additions and 4 deletions

View File

@@ -119,6 +119,13 @@ def main():
init_global_checks(red)
init_events(red, cli_flags)
# lib folder has to be in sys.path before trying to load any 3rd-party cog (GH-3061)
# We might want to change handling of requirements in Downloader at later date
LIB_PATH = data_manager.cog_data_path(raw_name="Downloader") / "lib"
LIB_PATH.mkdir(parents=True, exist_ok=True)
if str(LIB_PATH) not in sys.path:
sys.path.append(str(LIB_PATH))
red.add_cog(Core(red))
red.add_cog(CogManagerUI())
if cli_flags.dev: