title: How do I fix Python io.TextIOWrapper error message?
body: <p>I know there are several post that have asked this question and I have tried some of the solutions but I still keep getting the error message. Both of the following solutions produce the same error message. What am I doing wrong?</p>
  
  <p>Here is one solution I tried:</p>
  
  <pre><code>def main():
      #Open a file named numbers.txt
      numbers_file = open('numbers.txt','r')
  
      #read the numbers on the file
      file_contents = numbers_file.read()
  
      #Close the the numbers file
      numbers_file.close()
  
      #Print the data that was inside the file
      print(numbers_file)
  
  #Call the main function
  main()
  </code></pre>
  
  <p>Here is another solution I tried:</p>
  
  <pre><code>with open(r"numbers.txt",'r') as numbers_file:
      #read the numbers on the file
      file_contents = numbers_file.read()
  
      #Close the the numbers file
      numbers_file.close()
  
      #Print the data that was inside the file
      print(numbers_file)
  </code></pre>
  
  <p>The error message I get when I run either of the programs is:</p>
  
  <pre><code>&lt;_io.TextIOWrapper name='numbers.txt' mode='r' encoding='cp1252'&gt;
  </code></pre>