Skip to content

getpeername may return different numbers of arguments #261

@najohnsn

Description

@najohnsn

In one situation where IPV6 is used, the following occurred after entering the zti SESSION command:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/u/ibmuser/.local/lib/python3.12/site-packages/tnz/zti.py", line 54, in <module>
    raise SystemExit(zti.main())
                     ^^^^^^^^^^
  File "/u/ibmuser/.local/lib/python3.12/site-packages/tnz/zti.py", line 3591, in main
    zti.cmdloop(intro)
  File "/u/ibmuser/.local/lib/python3.12/site-packages/tnz/zti.py", line 201, in cmdloop
    super().cmdloop(intro=text)
  File "/usr/lpp/IBM/cyp/v3r12/pyz/lib/python3.12/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
           ^^^^^^^^^^^^^^^^^
  File "/usr/lpp/IBM/cyp/v3r12/pyz/lib/python3.12/cmd.py", line 217, in onecmd
    return func(arg)
           ^^^^^^^^^
  File "/u/ibmuser/.local/lib/python3.12/site-packages/tnz/zti.py", line 770, in do_session
    pnaddr, pnport = tns.getpeername()
    ^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 2)

Some further debugging shows that transport.get_extra_info("peername") returned 4 values: ('::1', 23, 0, 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions