buffer interface problem

  • Thread starter Andrew Gillanders
  • Start date
A

Andrew Gillanders

I have run into a problem running a Python script that is part of the
TerraGear suite for building scenery for FlightGear. I am using Mac
OS X 10.4, running Python (version 3.0.1) in a Unix terminal.

The purpose of the script is to walk a directory tree, unzipping
files, and passing the contents to an executable C programme. The
problem occurs here:

gzin = GzipFile(fname, 'rb')
data = gzin.readline()
min_x,min_y = map(atoi,data.split()[:2])

The input file, when uncompressed, is an ASCII file with a line with
two numbers, then a line of four numbers, then many long lines of
numbers. I can see what the last is trying to do: split the string
into two words, convert them to integers, and assign them to min_x
and min_y.

At the third line, I get the message "expected an object with the
buffer interface". Which object is it referring to? Have some
functions been changed to pass buffer objects instead of strings? How
can I fix the source code to make it run?

Any help appreciated
Andrew
(Python newbie)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top