code: def __read_to(self, terminator: bytes) -> bytes:
          
          try:
              # noinspection PyTypeChecker
              i = self.data.index(terminator, self.idx)
              b = self.data[self.idx:i]
              self.idx = i + 1
              return b
          except ValueError:
              raise bencodepy.DecodingError(
                  'Unable to locate terminator character "{0}" after index {1}.'.format(str(terminator), str(self.idx)))
docs: Returns bytes from self.data starting at index (self.idx) until terminator character.