@@ -935,16 +935,17 @@ def create_wrapper(plugin: InstInfo):
935935 then run the plugin from within the same process.'''
936936 assert hasattr (plugin , 'venv' )
937937 venv_full_path = Path (plugin .source_loc ) / plugin .venv
938+ real_source_loc = str (Path (plugin .source_loc ).resolve ())
938939 with open (Path (plugin .source_loc ) / plugin .entry , 'w' ) as wrapper :
939940 wrapper .write ((f"#!{ venv_full_path } /bin/python\n "
940941 "import sys\n "
941942 "import runpy\n \n "
942- f"if '{ plugin . source_loc } /{ plugin .subdir } ' not in "
943+ f"if '{ real_source_loc } /{ plugin .subdir } ' not in "
943944 "sys.path:\n "
944- f" sys.path.append('{ plugin . source_loc } /"
945+ f" sys.path.append('{ real_source_loc } /"
945946 f"{ plugin .subdir } ')\n "
946- f"if '{ plugin . source_loc } ' in sys.path:\n "
947- f" sys.path.remove('{ plugin . source_loc } ')\n "
947+ f"if '{ real_source_loc } ' in sys.path:\n "
948+ f" sys.path.remove('{ real_source_loc } ')\n "
948949 f"runpy.run_module(\" { plugin .name } \" , "
949950 "{}, \" __main__\" )" ))
950951 wrapper_file = Path (plugin .source_loc ) / plugin .entry
@@ -1875,7 +1876,7 @@ def enable(plugin_name: str):
18751876 except NotFoundError as err :
18761877 log .error (err )
18771878 return None
1878- path = inst .entry
1879+ path = str ( Path ( inst .entry ). resolve ())
18791880 if not Path (path ).exists ():
18801881 log .error (f'cannot find installed plugin at expected path { path } ' )
18811882 return None
@@ -1907,7 +1908,7 @@ def disable(plugin_name: str):
19071908 except NotFoundError as err :
19081909 log .warning (f'failed to disable: { err } ' )
19091910 return None
1910- path = inst .entry
1911+ path = str ( Path ( inst .entry ). resolve ())
19111912 if not Path (path ).exists ():
19121913 sys .stderr .write (f'Could not find plugin at { path } \n ' )
19131914 return None
0 commit comments