code: def tail(self, fname, encoding, window, position=None):
          
          if window <= 0:
              raise ValueError('invalid window %r' % window)
  
          encodings = ENCODINGS
          if encoding:
              encodings = [encoding] + ENCODINGS
  
          for enc in encodings:
              try:
                  f = self.open(encoding=enc)
                  if f:
                      return self.tail_read(f, window, position=position)
  
                  return False
              except IOError, err:
                  if err.errno == errno.ENOENT:
                      return []
                  raise
              except UnicodeDecodeError:
                  pass
docs: Read last N lines from file fname.