OS:Error Transport endpoint is not connected

with open(mapfile,’r’) as fp:

mp = (
    st.strip().split('  ')
    for st in fp.readlines()
)

fixpath = lambda x: os.path.abspath(os.path.join(data_dir,x))
mp = (
    (fixpath(x(0)), fixpath(x(1)))
    for x in mp
)

Is this piece of code Ok?
I’m running it on colab