Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usb_cdc.serial.read() doc says it reads one byte, but it will read as much as possible #9365

Open
dhalbert opened this issue Jun 22, 2024 · 1 comment · May be fixed by #10019
Open

usb_cdc.serial.read() doc says it reads one byte, but it will read as much as possible #9365

dhalbert opened this issue Jun 22, 2024 · 1 comment · May be fixed by #10019
Assignees
Milestone

Comments

@dhalbert
Copy link
Collaborator

Right now the documentation for usb_cdc.serial.read() gives the signature as usb_cdc.serial.read(size = 1). That is, it reads a at most a single byte. This does not match the implementation: it actually tries to read as much as possible, because it uses the standard stream operation read(), which has those semantics.

Pyserial's read() has the same signature and does read only one byte if no argument is given. I think our original intention was to match pyserial.

So rather than change the documentation, we should probably fix the implementation.

@dhalbert dhalbert added the usb label Jun 22, 2024
@dhalbert dhalbert added this to the 9.x.x milestone Jun 22, 2024
@tannewt tannewt added the bug label Jun 24, 2024
@dhalbert dhalbert self-assigned this Aug 28, 2024
@dhalbert
Copy link
Collaborator Author

There are complaints about pyserial's read() behavior:

I'm now thinking we may not necessarily want to mimic pyserial so closely. pyserial also oddly released v3.5 to pypi but did not tag the release in github, which shows the last release as v3.4. There have been no commits to master since August 2023.

@dhalbert dhalbert linked a pull request Jan 30, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants