Skip to content

Replace the obsolete library telnetlib#1228

Merged
bcoconni merged 1 commit intoJSBSim-Team:masterfrom
bcoconni:telnetlib
Mar 21, 2025
Merged

Replace the obsolete library telnetlib#1228
bcoconni merged 1 commit intoJSBSim-Team:masterfrom
bcoconni:telnetlib

Conversation

@bcoconni
Copy link
Member

@bcoconni bcoconni commented Feb 8, 2025

We are using the library telnetlib in our test tests/TestInputSocket.py. However, according to the PEP 594, starting from Python 3.13, the library is no longer part of the Python standard library.

I guess this is in reaction to community complaints such as Amber Brown's talk: Batteries Included, But They're Leaking which apparently drove Guido van Rossum mad (he left the room). So the Python foundation elected to solve the problem by pushing the red button and nuking a number of poorly maintained standard libraries such as telnetlib (check PEP 594 for details).

We are quite fortunate that telnetlib is among the few libraries for which PEP 594 suggests alternatives: telnetlib3 and Exscript. The latter is obviously over-engineered for our need so I've chosen telnetlib3.

Pros:

  • This PR allows TestInputsocket.py to be executed by Python 3.13+
  • telnetlib3 relies on asyncio which should resolve a number of synchronization problems we are having and that are leading to CI jobs random failure.

Cons:

  • It's unclear whether or not the author is willing to maintain the library in the long term. No change has been committed to the repo for the last 2 years and the author seldomly answer issues.
  • Even though TestInputSocket works well for the CI workflow, I've had a couple of instances where the test was hanging (mostly on Windows). This means that we might be unable to run the test locally.

@codecov
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 24.77%. Comparing base (40fe739) to head (7efff5b).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/input_output/FGfdmSocket.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1228   +/-   ##
=======================================
  Coverage   24.77%   24.77%           
=======================================
  Files         169      169           
  Lines       19421    19421           
=======================================
  Hits         4812     4812           
  Misses      14609    14609           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bcoconni bcoconni merged commit 09c19cb into JSBSim-Team:master Mar 21, 2025
29 checks passed
@bcoconni bcoconni deleted the telnetlib branch March 21, 2025 11:34
bcoconni added a commit to bcoconni/jsbsim that referenced this pull request Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant