title: python - file was loaded in the wrong encoding utf-8
body: <p>im quite new to programing and i don´t understand this error message i get, <code>file was loaded in the wrong encoding utf-8</code> or it´s not really a error message in the code but i get it in my new .txt file where i write all found keywords to. The .txt file get upp to 4000+ rows with information that i sort to Excel in another program and later send it to Access. What dose the message mean and is thhere a way to fix it? Thanks</p>
  
  <p>im using pycharm with anaconda36</p>
  
  <p><a href="https://i.stack.imgur.com/bG46D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bG46D.png" alt="enter image description here"></a></p>
  
  <pre><code>import glob
  
  
  def LogFile(filename, tester):
  
      data = []
      with open(filename) as filesearch:   # open search file
          filesearch = filesearch.readlines()   # read file
      file = filename[37:]
      for line in filesearch:
          if tester in line:   # extract "Create Time"
              short = line[30:]
              data.append(short)   # store all found wors in array
  
      print (file)
  
      with open('Msg.txt', 'a') as handler:  # create .txt file
  
          for i in range(len(data)):
              handler.write(f"{file}|{data[i]}")
  
  
  # open with 'w' to "reset" the file.
  with open('LogFile.txt', 'w') as file_handler:
      pass
  # ---------------------------------------------------------------------------------
  
  for filename in glob.glob(r'C:\Users\Documents\Access\\GTX797\*.log'):
      LogFile(filename, 'Sending Request: Tester')
  </code></pre>