diff --git a/jedi/evaluate/compiled/subprocess/__init__.py b/jedi/evaluate/compiled/subprocess/__init__.py index 7b0ef74c..4c251076 100644 --- a/jedi/evaluate/compiled/subprocess/__init__.py +++ b/jedi/evaluate/compiled/subprocess/__init__.py @@ -256,6 +256,8 @@ class Listener(object): try: result = False, self._run(*payload) except Exception as e: + #import traceback + #print_to_stderr(traceback.format_exc()) result = True, e pickle.dump(result, file=stdout, protocol=_PICKLE_PROTOCOL) diff --git a/jedi/evaluate/imports.py b/jedi/evaluate/imports.py index d00fdcbc..eac4c69e 100644 --- a/jedi/evaluate/imports.py +++ b/jedi/evaluate/imports.py @@ -20,7 +20,7 @@ from parso.tree import search_ancestor from parso.cache import parser_cache from parso import python_bytes_to_unicode -from jedi._compatibility import unicode, ImplicitNSInfo +from jedi._compatibility import unicode, ImplicitNSInfo, force_unicode from jedi import debug from jedi import settings from jedi.evaluate import sys_path @@ -254,12 +254,12 @@ class Importer(object): if self.import_path: # TODO is this check really needed? for path in sys_path.traverse_parents(self.file_path): if os.path.basename(path) == self.str_import_path[0]: - in_path.append(os.path.dirname(path)) + in_path.append(force_unicode(os.path.dirname(path))) # Since we know nothing about the call location of the sys.path, # it's a possibility that the current directory is the origin of # the Python execution. - sys_path_mod.insert(0, os.path.dirname(self.file_path)) + sys_path_mod.insert(0, force_unicode(os.path.dirname(self.file_path))) return in_path + sys_path_mod diff --git a/jedi/evaluate/project.py b/jedi/evaluate/project.py index 80d618f5..1ea043ea 100644 --- a/jedi/evaluate/project.py +++ b/jedi/evaluate/project.py @@ -1,3 +1,4 @@ +from jedi._compatibility import force_unicode from jedi.evaluate.sys_path import detect_additional_paths from jedi.cache import memoize_method @@ -30,4 +31,8 @@ class Project(object): if self._script_path is None: return sys_path - return sys_path + detect_additional_paths(self._evaluator, self._script_path) + added_paths = map( + force_unicode, + detect_additional_paths(self._evaluator, self._script_path) + ) + return sys_path + added_paths