That's because each line ends with newline character(s).
You can fix it like this (and automatically close the file):
def main():
with open("test.txt", "r") as fileR:
for line in (line.rstrip() for line in fileR):
if line.endswith('
'):
line = line[:-6]
print line