Skip to content

"unix" should be added to conn_tmap on illumos/SunOS too #2549

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ XXXX-XX-XX
- 2542_: if system clock is updated `Process.children()`_ and
`Process.parent()`_ may not be able to return the right information.
- 2545_: [illumos]: Fix handling of MIB2_UDP_ENTRY in `net_connections()`_.
- 2547_: [illumos]: Add "unix" to conn_tmap on illumos/SunOS too.
Copy link
Owner

@giampaolo giampaolo Apr 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the change exactly? Was only the unit test that was broken or the functionality (net_connections()) per se? If the former, please explain what was the problem (exception? crash?).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change exactly is to add "unix" back to conn_tmap as it was before December 2024.

I found the issue by running psutil's tests. I do not use psutil for anything specific. I just package it for OpenIndiana (and so I run its tests to make sure it works), primarily because it is needed by some other Python projects packaged.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like UNIX sockets are not supported on SunOS, that's why I removed it:

Only INET sockets are returned (UNIX are not).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I easily confirm that (or prove it is wrong)?


7.0.0
=====
Expand Down
2 changes: 1 addition & 1 deletion psutil/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class BatteryTime(enum.IntEnum):
"udp6": ([AF_INET6], [SOCK_DGRAM]),
})

if AF_UNIX is not None and not SUNOS:
if AF_UNIX is not None:
conn_tmap.update({"unix": ([AF_UNIX], [SOCK_STREAM, SOCK_DGRAM])})


Expand Down
Loading