Request Help With Byte/String Problem
Wildman
best_lay at yahoo.com
Thu Dec 1 22:09:20 EST 2016
On Wed, 30 Nov 2016 07:54:45 -0500, Dennis Lee Bieber wrote:
> On Tue, 29 Nov 2016 22:01:51 -0600, Wildman via Python-list
> <python-list at python.org> declaimed the following:
>
>>I really appreciate your reply. Your suggestion fixed that
>>problem, however, a new error appeared. I am doing some
>>research to try to figure it out but no luck so far.
>>
>>Traceback (most recent call last):
>> File "./ifaces.py", line 33, in <module>
>> ifs = all_interfaces()
>> File "./ifaces.py", line 21, in all_interfaces
>> name = namestr[i:i+16].split('\0', 1)[0]
>>TypeError: Type str doesn't support the buffer API
>
> The odds are good that this is the same class of problem -- you are
> providing a Unicode string to a procedure that wants a byte-string (or vice
> versa)
>
> https://docs.python.org/3/library/array.html?highlight=tostring#array.array.tostring
That helped. Thanks.
--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!
More information about the Python-list
mailing list