On Sun, Nov 2, 2025 at 8:08 PM Stuart Henderson <[email protected]> wrote:
On 2025/11/02 16:48, Sebastian Reitenbach wrote:
Hi,
as pointed out by Stuart, Python will drop telnetlib from core Python in
version 3.13.
Here's a port of the library to a standalone package. Tests don't work,
they assume the library
is installed in the standard location, but that's not the case? Don't
really know how to make
them work.
tarball attached, any comments, or suggestions are welcome.
cheers,
Sebastian
your commented-out PKGNAME line should be uncommented.
otherwise ok.
doh, will fix.
tests nearly all work for me, just one error and a warning, which seems
ok:
===> Regression tests for py3-standard-telnetlib-3.13.0
============================= test session starts
==============================
platform openbsd7 -- Python 3.12.12, pytest-8.4.2, pluggy-1.6.0
rootdir: /usr/obj/ports/py-standard-telnetlib-3.13.0/standard_telnetlib-3.13.0
configfile: pyproject.toml
collected 21 items
tests/test_telnetlib.py .......E............. [100%]
==================================== ERRORS
====================================
________________________ ERROR at setup of test_socket
_________________________
file
/usr/obj/ports/py-standard-telnetlib-3.13.0/standard_telnetlib-3.13.0/tests/test_telnetlib.py,
line 154
@contextlib.contextmanager
def test_socket(reads):
E fixture 'reads' not found
available fixtures: cache, capfd, capfdbinary, caplog, capsys,
capsysbinary, capteesys, doctest_namespace, monkeypatch, pytestconfig,
record_property, record_testsuite_property, record_xml_attribute, recwarn,
tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
use 'pytest --fixtures [testpath]' for help on them.
my test VM is a couple of days old, still with Python 3.12.11, I see:
===> py3-standard-telnetlib-3.13.0 depends on: py3-test-* -> py3-test-8.4.2p0
===> Regression tests for py3-standard-telnetlib-3.13.0
============================= test session starts
==============================
platform openbsd7 -- Python 3.12.11, pytest-8.4.2, pluggy-1.6.0
rootdir:
/var/ports/pobj/amd64/py-standard-telnetlib-3.13.0/standard_telnetlib-3.13.0
configfile: pyproject.toml
plugins: anyio-4.9.0
collected 0 items / 1 error
==================================== ERRORS
====================================
___________________ ERROR collecting tests/test_telnetlib.py
___________________
ImportError while importing test module
'/var/ports/pobj/amd64/py-standard-telnetlib-3.13.0/standard_telnetlib-3.13.0/tests/test_telnetlib.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_telnetlib.py:6: in <module>
from test import support
E ModuleNotFoundError: No module named 'test'
=========================== short test summary info
============================
ERROR tests/test_telnetlib.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection
!!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 1.21s
===============================
*** Error 2 in . (/home/ports/lang/python/3/python.port.mk:335 'do-test': @
cd /home/ports/pobj/amd64/py-standard-telnetlib-3.13.0/standard_...)
*** Error 2 in . (/home/ports/infrastructure/mk/bsd.port.mk:3096
'/home/ports/pobj/amd64/py-standard-telnetlib-3.13.0/.test_done': @cd /home...)
*** Error 2 in /home/ports/net/py-standard-telnetlib
(/home/ports/infrastructure/mk/bsd.port.mk:2710 'test':
@lock=py3-standard-telnetlib-3....)
And also after uninstalling py3-anyio I see:
===> Regression tests for py3-standard-telnetlib-3.13.0
============================= test session starts
==============================
platform openbsd7 -- Python 3.12.11, pytest-8.4.2, pluggy-1.6.0
rootdir:
/var/ports/pobj/amd64/py-standard-telnetlib-3.13.0/standard_telnetlib-3.13.0
configfile: pyproject.toml
collected 0 items / 1 error
==================================== ERRORS
====================================
___________________ ERROR collecting tests/test_telnetlib.py
___________________
ImportError while importing test module
'/var/ports/pobj/amd64/py-standard-telnetlib-3.13.0/standard_telnetlib-3.13.0/tests/test_telnetlib.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_telnetlib.py:6: in <module>
from test import support
E ModuleNotFoundError: No module named 'test'
=========================== short test summary info
============================
ERROR tests/test_telnetlib.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection
!!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 1.07s
===============================
*** Error 2 in . (/home/ports/lang/python/3/python.port.mk:335 'do-test': @
cd /home/ports/pobj/amd64/py-standard-telnetlib-3.13.0/standard_...)
*** Error 2 in . (/home/ports/infrastructure/mk/bsd.port.mk:3096
'/home/ports/pobj/amd64/py-standard-telnetlib-3.13.0/.test_done': @cd /home...)
*** Error 2 in /home/ports/net/py-standard-telnetlib
(/home/ports/infrastructure/mk/bsd.port.mk:2710 'test':
@lock=py3-standard-telnetlib-3....)
because it picks up py3-anyio for testing, should it be added to TEST_DEPENDS ?
I'll replace my test VM with latest snapshot, and retest again before
importing.
thanks,
Sebastian