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