docs: def open(self, name, mode='r', compression=None):
          """
              Open a file pointer. Note that a file is *always* opened in text
              mode. The method inherits its input parameters from the constructor
              of :class:`FileObject`.
          """
  
          if compression == 'use_ext':
              self.get_compression_type(name)
          else:
              self.ctype = compression
  
          if not self.ctype:
              self.fp = open(name, mode)
          elif self.ctype == 'gzip':
              self.fp = gzip.open(name, mode + 't')
          elif self.ctype == 'bzip2':
              try:
                  # Python 3 supports opening bzip2 files in text mode
                  # therefore, we prefer to open them this way
                  self.fp = bz2.open(name, mode + 't')
              except:
                  # BZ2File opens a file in binary mode
                  # thus, we have to use codecs.getreader()
                  # to be able to use it in text mode
                  self.fp_extra = bz2.BZ2File(name, mode)
  
                  if mode == 'r':
                      self.fp = codecs.getreader('ascii')(self.fp_extra)
                  else:  # mode == 'w'
                      self.fp = codecs.getwriter('ascii')(self.fp_extra)
          else:  # self.ctype == 'lzma'
              # LZMA is available in Python 2 only if backports.lzma is installed
              # Python 3 supports it by default
              assert lzma_present, 'LZMA compression is unavailable.'
              self.fp = lzma.open(name, mode=mode + 't')