##// END OF EJS Templates
Convert filename to bytes in getlines....
Jörgen Stenarson -
Show More
@@ -5,6 +5,7 b' itself.'
5 """
5 """
6 import functools
6 import functools
7 import linecache
7 import linecache
8 import sys
8
9
9 from IPython.utils import py3compat
10 from IPython.utils import py3compat
10 from IPython.utils import openpy
11 from IPython.utils import openpy
@@ -21,6 +22,7 b' else:'
21 def getlines(filename, module_globals=None):
22 def getlines(filename, module_globals=None):
22 """Get the lines (as unicode) for a file from the cache.
23 """Get the lines (as unicode) for a file from the cache.
23 Update the cache if it doesn't contain an entry for this file already."""
24 Update the cache if it doesn't contain an entry for this file already."""
25 filename = py3compat.cast_bytes(filename, sys.getfilesystemencoding())
24 lines = linecache.getlines(filename, module_globals=module_globals)
26 lines = linecache.getlines(filename, module_globals=module_globals)
25
27
26 # The bits we cache ourselves can be unicode.
28 # The bits we cache ourselves can be unicode.
General Comments 0
You need to be logged in to leave comments. Login now