Commit b1311715 by heffnercj

Updated BlockFile for better compatability with python2.6

parent 38bb8a57
...@@ -121,6 +121,9 @@ class BlockFile(io.FileIO): ...@@ -121,6 +121,9 @@ class BlockFile(io.FileIO):
Returns None. Returns None.
''' '''
self.total_read = 0 self.total_read = 0
# Python 2.6 doesn't like modes like 'rb' or 'wb'
self.mode = mode.replace('b', '')
try: try:
self.size = file_size(fname) self.size = file_size(fname)
...@@ -137,7 +140,7 @@ class BlockFile(io.FileIO): ...@@ -137,7 +140,7 @@ class BlockFile(io.FileIO):
else: else:
self.length = self.size self.length = self.size
io.FileIO.__init__(self, fname, mode) io.FileIO.__init__(self, fname, self.mode)
# Work around for python 2.6 where FileIO._name is not defined # Work around for python 2.6 where FileIO._name is not defined
try: try:
......
...@@ -23,6 +23,7 @@ function redhat ...@@ -23,6 +23,7 @@ function redhat
function darwin function darwin
{ {
# TODO: py-magic is OLD. Download and build from source?
sudo port install git-core arj p7zip py-magic py-matplotlib sudo port install git-core arj p7zip py-magic py-matplotlib
} }
......
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