title: TypeError: expected str, bytes or os.PathLike object, not list
body: <p>Here is my main file code</p>
  
  <pre><code>import moduleA as moduleA
  import os
  
  filename1 = os.path.join(os.getcwd(),'script01.txt') 
  filename2 = os.path.join(os.getcwd(),'script02.txt') 
  myList1 = moduleA.get_file(filename1)
  myList2 = moduleA.get_file(filename2)
  </code></pre>
  
  <p>Here is my moduleA code</p>
  
  <pre><code>def get_file(filename):
      myList = []
      with open (filename) as filename:
          for line in filename:
              myList.append(line)
      return myList
  </code></pre>
  
  <p>I got an error saying that in get_file with open (filename) as filename:</p>
  
  <pre><code>TypeError: expected str, bytes or os.PathLike object, not list   
  </code></pre>
  
  <p>I have checked that <code>type(filename1)</code> is string. I don't know where did I get wrong</p>