This issue caused a load of issues with the ca-certificates. Example of partial readline(): 0|obj|/usr/share/ca-certificates/mozilla/NetLock_Arany_=Class_Gold=_F\xc3\x85 and the next call: \xc2\x91tan\xc3\x83\xc2\xbas\xc3\x83\xc2\xadtv\xc3\x83\xc2\xa1ny.crt\n Trying to workaround it by reading ahead if line does not end with \n