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

python 3.13 doesn't include telnetlib #2261

Closed
sdelafond opened this issue Oct 9, 2024 · 9 comments
Closed

python 3.13 doesn't include telnetlib #2261

sdelafond opened this issue Oct 9, 2024 · 9 comments

Comments

@sdelafond
Copy link
Contributor

Describe the bug
python3.13 removes the telnetlib module, which is used in in hddtemp.

Your py3status version
py3status version 3.59 (python 3.12.6) on i3

To Reproduce
Run py3status with python3.13 against and hddtemp-enabled config:

2024-10-09 14:08:59 INFO Module `hddtemp` could not be loaded (No module named 'telnetlib')

Expected behavior
Success with python3.13, using something else than telnetlib.

Additional context
This is Debian bug https://bugs.debian.org/1084713: as the next Debian stable will be released with python 3.13, the presence of py3status is conditioned to a fix for this issue.

@valdur55
Copy link
Contributor

valdur55 commented Oct 9, 2024

Interesting catch.
Since version 3.12 it reminds that telnetlib is deprecated.
For me, using real telnet lib is real overkill.
One solution is just use
line = self.py3.command_output("nc localhost 7634")
Instead of line:

line = Telnet("localhost", 7634).read_all().decode("utf-8", "ignore")

@sdelafond
Copy link
Contributor Author

I'm totally fine with that fix, I guess you'll just need to document the additional dependency on nc, and I'll also have to include it as a Debian Depends:.

@lasers
Copy link
Contributor

lasers commented Oct 10, 2024

Make a PR.

@sdelafond
Copy link
Contributor Author

Ah sorry I won't have time to do that: my volunteer time is pretty much all used up on the Debian side. This bug report was only meant to properly report that the current version of py3status, which uses telnetlib, won't be able to get included in the next Debian stable release.

@lasers
Copy link
Contributor

lasers commented Oct 10, 2024

No problem. Thank you. One of us will be on it.

@sdelafond
Copy link
Contributor Author

BTW, as much as I hate to hijack an existing ticket to discuss other issues, I figure it may be worth it if it can avoid creating tickets you deem unnecessary:

  1. I have an existing bug report on the Debian side caused by /usr/lib/python3/dist-packages/py3status/modules/bluetooth.py:103: SyntaxWarning: invalid escape sequence '\?', with python 3.12 at least. It's absolutely not critical, and doesn't impact py3status' presence in Debian at all, but would you still like a proper issue about it?

  2. another early warning highlights that pkg_resources is deprecated in favor of importlib-based solutions (see https://setuptools.pypa.io/en/latest/pkg_resources.html); this one also has zero impact at this point, but if you want an issue about it I can open one.

valdur55 added a commit to valdur55/py3status that referenced this issue Oct 10, 2024
valdur55 added a commit to valdur55/py3status that referenced this issue Oct 10, 2024
@mlmatlock
Copy link
Contributor

Wouldn't the combo of kernel module drivetemp and py3status lm_sensors module work, rather than depending on the orphaned/unmaintained [1] hddtemp?

[1] https://savannah.nongnu.org/projects/hddtemp/

@lasers
Copy link
Contributor

lasers commented Oct 10, 2024

Possibly. If that works, then you can use that. Package lm_sensors could be orphaned/unmaintained too. If hddtemp still work, then we don't have to deprecate it today.

The issue at hand here isn't hddtemp being orphaned/unmaintained, but the fact that Python deprecated telnetlib in version 3.13 and will break this module. hddtemp itself isn't broken.

Easy fix is to going with a telnet command instead of telnetlib so we can still use this in practically any Python version. 100% salvageable.

@lasers
Copy link
Contributor

lasers commented Oct 27, 2024

@sdelafond Please fIle those new issues. 👍

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

No branches or pull requests

4 participants