Commit 41e389f5 authored by Barry Warsaw's avatar Barry Warsaw

FileIterator.__init__(): Open the file 'rb' since the iterator is a

read-only protocol.
parent 6fb972a0
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
# may have a back pointer to a version record or to a non-version # may have a back pointer to a version record or to a non-version
# record. # record.
# #
__version__='$Revision: 1.63 $'[11:-2] __version__='$Revision: 1.64 $'[11:-2]
import struct, time, os, bpthread, string, base64, sys import struct, time, os, bpthread, string, base64, sys
from struct import pack, unpack from struct import pack, unpack
...@@ -1979,7 +1979,7 @@ class FileIterator(Iterator): ...@@ -1979,7 +1979,7 @@ class FileIterator(Iterator):
_ltid=z64 _ltid=z64
def __init__(self, file): def __init__(self, file):
if type(file) is type(''): file=open(file, 'r+b') if type(file) is type(''): file=open(file, 'rb')
self._file=file self._file=file
if file.read(4) != packed_version: raise FileStorageFormatError, name if file.read(4) != packed_version: raise FileStorageFormatError, name
file.seek(0,2) file.seek(0,2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment