On 6/1/2010 5:40 PM, Colin Talbert wrote:
I am also experiencing this same problem. (Also on a OSM bz2
file). It appears to be working but then partway through reading a
file it simple ends. I did track down that file length is always
900000 so it appears to be related to some sort of buffer constraint.
Any other ideas?
How big is the file?
Is it necessary to read the entire thing at once?
Try opening with mode rb
import bz2
input_file = bz2.BZ2File(r"C:\temp\planet-latest.osm.bz2","r")
try:
all_data = input_file.read()
print str(len(all_data))
finally:
input_file.close()
--
Bob Gailer
919-636-4239
Chapel Hill NC
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor