This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Support fspath protocol in AF_UNIX sockaddr resolution
Type: Stage:
Components: Versions: Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, ethan.furman, njs
Priority: normal Keywords:

Created on 2018-01-16 02:23 by njs, last changed 2022-04-11 14:58 by admin.

Messages (1)
msg310034 - (view) Author: Nathaniel Smith (njs) * (Python committer) Date: 2018-01-16 02:23
In 3.6, trying to connect to a AF_UNIX socket using a pathlib.Path object doesn't work:

Python 3.6.4 (default, Dec 27 2017, 13:02:49) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket, pathlib
>>> s = socket.socket(family=socket.AF_UNIX)
>>> s.connect(pathlib.Path("asdf"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: a bytes-like object is required, not 'PosixPath'

It would be good to fix this to use the fspath protocol.
History
Date User Action Args
2022-04-11 14:58:56adminsetgithub: 76743
2021-09-08 00:49:54ethan.furmansetnosy: + ethan.furman
2018-01-16 02:23:17njscreate