GeezerVison is showing github.com — fix #496 · orecore/vscode-python@880edc1
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: pythonFiles/completion.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -410,7 +410,7 @@ def watch(self): |
410 | 410 | jediPreview = False |
411 | 411 | cachePrefix = 'v' |
412 | 412 | if len(sys.argv) > 0 and sys.argv[1] == 'preview': |
413 | | - jediPath = os.path.join(os.path.dirname(__file__), 'preview', 'jedi') |
| 413 | + jediPath = os.path.join(os.path.dirname(__file__), 'preview') |
414 | 414 | jediPreview = True |
415 | 415 | elif len(sys.argv) > 0 and sys.argv[1] == 'custom': |
416 | 416 | jediPath = sys.argv[2] |
|
Collapse file
Copy file name to clipboardExpand all lines: pythonFiles/preview/jedi/api/__init__.py +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -105,8 +105,12 @@ def __init__(self, source=None, line=None, column=None, path=None, |
105 | 105 |
|
106 | 106 | if source is None: |
107 | 107 | # TODO add a better warning than the traceback! |
108 | | - with open(path) as f: |
109 | | - source = f.read() |
| 108 | + try: |
| 109 | + with open(path) as f: |
| 110 | + source = f.read() |
| 111 | + except UnicodeDecodeError: |
| 112 | + with open(path, encoding=encoding) as f: |
| 113 | + source = f.read() |
110 | 114 |
|
111 | 115 | self._source = common.source_to_unicode(source, encoding) |
112 | 116 | self._code_lines = common.splitlines(self._source) |
|