New submission from Serhiy Storchaka:

getsockaddrarg() is an internal C function in the socket module implementation 
used in a number of socket methods (bind(), connect(), connect_ex(), sendto(), 
sendmsg()) for creating C structure sock_addr_t from Python tuple. Error 
messages raised when pass incorrect socket address argument to these function 
contain the name "getsockaddrarg" despite the fact that it is not directly 
exposed at Python level, nor the name of standard C function.

>>> import socket
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.bind(42)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: getsockaddrarg: AF_INET address must be tuple, not int
>>> s.bind(())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: getsockaddrarg() takes exactly 2 arguments (0 given)

I think that error messages shouldn't refer to non-existing function 
"getsockaddrarg()".

This issue is a part of more general issue28261.

----------
components: Extension Modules
messages: 289745
nosy: Oren Milman, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Don't refer to getsockaddrarg in error messages
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29832>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to