[Biopython] Fwd: Bug in bgzf module

Petra Kubincová petra.kubincova at gmail.com
Wed Jan 30 16:50:50 EST 2013


Hello,

recently I have installed and tried out biopython 1.60, especially bgzf
module. I have discovered that calling method "tell()" of object of
bgzf.BgzfWriter type raises this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/dist-packages/Bio/bgzf.py", line 743, in
tell
    return make_virtual_offset(self.handle.tell(), len(self._buffer))
AttributeError: 'BgzfWriter' object has no attribute 'handle'

I've checked out source code of bgzf module. Source code of error-raising
method "tell()" looks like this:

def tell(self):
    """Returns a BGZF 64-bit virtual offset."""
    return make_virtual_offset(self.handle.tell(), len(self._buffer))

The problem is that BgzfWriter does not have variable called "handle", only
"_handle". So (IMHO) all that needs to be done to fix this bug is change
"self.handle.tell()" to "self._handle.tell()".

Cheers,
Petra Kubincova


More information about the Biopython mailing list