Repository navigation
Drop unused telnetlib import that breaks two scripts on Python 3.13 - #445
Open
kasparovabi wants to merge 1 commit into
Open
kasparovabi wants to merge 1 commit into
kasparovabi wants to merge 1 commit into
Conversation
Python 3.13 removed telnetlib (PEP 594), so both scripts fail at import with ModuleNotFoundError. Neither script references telnetlib beyond the import line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python 3.13 removed
telnetlib(PEP 594, What's New in 3.13).openwrt_ctl.pyandtos_plus_auto.pyimport it at the top but never use it, so on 3.13 both scripts stop before parsing arguments.openwrt_ctl.pyimport telnetlib(line 30)tos_plus_auto.pyimport telnetlib(line 26)Neither file refers to
telnetlibanywhere else. Both drive their sessions throughpexpect.What I ran, in
python:3.12-slimandpython:3.13-slimcontainers with no network and a stubpexpectmodule on the path:tos_plus_auto.pygives the same result. On 3.12 the--helpoutput of both scripts is byte for byte the same before and after the change. Both files still parse under Python 3.7, the version the lint job uses. I did not run them against a LANforge system or an OpenWrt device.Four other files also import
telnetlib, and these ones actually calltelnetlib.Telnet, so I left them alone. They aremux_client.py,py-scripts/lf_rfgen_info.py,py-scripts/sandbox/custom_sta_telnet.pyandpy-scripts/sandbox/iot_traffic.py. Replacing them means picking a new client (a raw socket,pexpect, or a third party package), which is your call.Happy to adjust this or close it if it does not fit the project.