I use two different scripts. In the first one, there is something like this:

```
f = open(filename, 'r')

file, file_ext = os.path.splitext(filename)

thumb=open(file +"_thumb.txt","w")

  for line in f:
   array = line.split(',')

   a = str(array[0])   

   t=a[11:14]+ "\\" + a[15:19] + "\\" + (a[11:])+".jpg" +"\n"

   thumb.write(t)

thumb.close()

```

In the second one: 

```
Dirname = str(self.lneDirIn1.text())

f=open(file +"_thumb.txt","r")

for line in f:
   line=str(line)

   print(line)

   cl_img_path=os.path.normpath((os.path.join(Dirname,line)))

   print(cl_img_path)

   cl_img=Image.open(str(cl_img_path))

```

When I run the second one, there is an error because `os.path.join` actually joins the "\n" of the line, so `cl_img` cannot be opened. However, When I print the "line" alone, it doesn't display the '\n'

Here is the error:

```
Traceback (most recent call last):
  File "./midas/mds_central_line_thumbs.py", line 118, in pbtOKClicked
    self.process()
  File "./midas/mds_central_line_thumbs.py", line 105, in process
    cl_img=Image.open(str(cl_img_path))
  File "C:\0adtoolsv2\libs\Python27\lib\site-packages\PIL\Image.py", line 1952, in open
    fp = __builtin__.open(fp, "rb")
IOError: [Errno 22] invalid mode ('rb') or filename: 'k:\\SBU_3\\USA\\PIO2015\\04-TEST-SAMPLES\\USCASFX1608\\D16MMDD\\B3\\Images\\051\\0151\\051_0151_00021466.jpg\n'

```

I'd like that my second script doesn't take the "\n" (necessary in the first script) into account when opening the file

Thank you very much, Guillaume.