(self)
return tarinfo
Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
Return the next member of the archive as a TarInfo object when TarFile is opened for reading . Return None if there is no more available .
def next(self):
        """Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
        """
        self._check("ra")
        if self.firstmember is not None:
            m = self.firstmember
            self.firstmember = None
            return m

        # Advance the file pointer.
        if self.offset != self.fileobj.tell():
            self.fileobj.seek(self.offset - 1)
            if not self.fileobj.read(1):
                raise ReadError("unexpected end of data")

        # Read the next block.
        tarinfo = None
        while True:
            try:
                tarinfo = self.tarinfo.fromtarfile(self)
            except EOFHeaderError as e:
                if self.ignore_zeros:
                    self._dbg(2, "0x%X: %s" % (self.offset, e))
                    self.offset += BLOCKSIZE
                    continue
            except InvalidHeaderError as e:
                if self.ignore_zeros:
                    self._dbg(2, "0x%X: %s" % (self.offset, e))
                    self.offset += BLOCKSIZE
                    continue
                elif self.offset == 0:
                    raise ReadError(str(e)) from None
            except EmptyHeaderError:
                if self.offset == 0:
                    raise ReadError("empty file") from None
            except TruncatedHeaderError as e:
                if self.offset == 0:
                    raise ReadError(str(e)) from None
            except SubsequentHeaderError as e:
                raise ReadError(str(e)) from None
            except Exception as e:
                try:
                    import zlib
                    if isinstance(e, zlib.error):
                        raise ReadError(f'zlib error: {e}') from None
                    else:
                        raise e
                except ImportError:
                    raise e
            break

        if tarinfo is not None:
            self.members.append(tarinfo)
        else:
            self._loaded = True

        return tarinfo
def next ( self ) : self . _check ( "ra" ) if self . firstmember is not None : m = self . firstmember self . firstmember = None return m # Advance the file pointer. if self . offset != self . fileobj . tell ( ) : self . fileobj . seek ( self . offset - 1 ) if not self . fileobj . read ( 1 ) : raise ReadError ( "unexpected end of data" ) # Read the next block. tarinfo = None while True : try : tarinfo = self . tarinfo . fromtarfile ( self ) except EOFHeaderError as e : if self . ignore_zeros : self . _dbg ( 2 , "0x%X: %s" % ( self . offset , e ) ) self . offset += BLOCKSIZE continue except InvalidHeaderError as e : if self . ignore_zeros : self . _dbg ( 2 , "0x%X: %s" % ( self . offset , e ) ) self . offset += BLOCKSIZE continue elif self . offset == 0 : raise ReadError ( str ( e ) ) from None except EmptyHeaderError : if self . offset == 0 : raise ReadError ( "empty file" ) from None except TruncatedHeaderError as e : if self . offset == 0 : raise ReadError ( str ( e ) ) from None except SubsequentHeaderError as e : raise ReadError ( str ( e ) ) from None except Exception as e : try : import zlib if isinstance ( e , zlib . error ) : raise ReadError ( f'zlib error: {e}' ) from None else : raise e except ImportError : raise e break if tarinfo is not None : self . members . append ( tarinfo ) else : self . _loaded = True return tarinfo