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

fix Telnet#expect (stdlib/telnetlib.pyi) #13377

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pinterior
Copy link

telnetlib.Telnet#expect copies given sequence and may modify it. https://github.com/python/cpython/blob/2dc476bcb9142cd25d7e1d52392b73a3dcdf1756/Lib/telnetlib.py#L612-L617
So, when a read-only sequence contains bytes (e.g. tuple of bytes) is passed to expect, TypeError is raised at runtime.

This PR fixes the argument type of the list parameter of Telnet#expect to reject Sequence containing bytes.

I know telnetlib is already removed from stdlib in Python 3.13, but this fix may help users of 3.12 and future users of https://pypi.org/project/standard-telnetlib/ etc.

Copy link
Contributor

github-actions bot commented Jan 8, 2025

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant