469,927 Members | 1,832 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

buffer_info error

Hello,

buffer_info is giving the following error:

AttributeError: 'str' object has not attribute 'buffer_info'

Here's the code snippet...

dest = 'FFFFFFFFFFFF'
src = '0123FFFFFFFF'

data = array('B', '\0' * 256)
data1 = ''.join([dest, src]
print data1
FFFFFFFFFFFF0123FFFFFFFF

print data.buffer_info()[0]... works

print data1.buffer_info()[0]....error

This output is a string and hence i believe i get the above error. Any
ideas?
Thanks,
-Ashton

Jul 19 '05 #1
2 1285
as*****@gmail.com wrote:
data = array('B', '\0' * 256)
data1 = ''.join([dest, src]

print data.buffer_info()[0]... works
print data1.buffer_info()[0]....error

This output is a string and hence i believe i get the above error. Any
ideas?


Yes, you are entirely correct. (Integers don't have "buffer_info"
attributes either, and for that matter strings don't have an attribute
called "fribble_frabble", in case you were thinking of trying that. ;-)

(That's a facetious reply, yes, because you gave no indication what you
were trying to accomplish. It's really hard to tell what you expected
versus what you got, and why you got that is completely obvious to all
of us, who can't read your mind.)

-Peter
Jul 19 '05 #2
i am filling in a packet with source and destination address and using
the buffer_info call to pass on the address to an underlying low level
call.

The src and dest are strings, but buffer_info expects an array. How do
i deal with this?

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Tony Wright | last post: by
1 post views Thread by Aravind | last post: by
1 post views Thread by yanwan | last post: by
5 posts views Thread by Enos Meroka | last post: by
7 posts views Thread by p | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.