Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

AttributeError: 'socket' object has no attribute 'readinto' #610

@rroeber

Description

@rroeber

Board: fipy

Firmware info:

(sysname='FiPy', nodename='FiPy', release='1.20.2.r6', version='v1.11-c5a0a97 on 2021-10-28', machine='FiPy with ESP32', lorawan='1.0.2', sigfox='1.0.1', pybytes='1.7.1')

I implemented a function to read data from a socket connection into a buffer. The relevant code is:

s = socket.socket(socket.AF_LORA, socket.SOCK_RAW) 

buf = bytearray(NUM_PACKETS)
mv = memoryview(buf)

idx = 0
while idx < num_packets:
    bytes_read = s.readinto(mv[idx:])
    idx += bytes_read
    print('.', end='')

The s.send() and s.receive() functions elsewhere in my program work correctly. When the program executes the s.readinto() function it gives the error:
AttributeError: 'socket' object has no attribute 'readinto'

What do I need to do to correct the error?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions