Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
fix the source file read mode issue.
if use 'r' mode, this may raise a `UnicodeDecodeError`.
  • Loading branch information
Cologler committed Nov 8, 2016
1 parent 5ef8747 commit a51475d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jedi/api/__init__.py
Expand Up @@ -105,7 +105,7 @@ def __init__(self, source=None, line=None, column=None, path=None,

if source is None:
# TODO add a better warning than the traceback!
with open(path) as f:
with open(path, 'rb') as f:
source = f.read()

self._source = common.source_to_unicode(source, encoding)
Expand Down

0 comments on commit a51475d

Please sign in to comment.