Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue29832

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Don't refer to getsockaddrarg in error messages
Type:enhancementStage:resolved
Components:Extension ModulesVersions:Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Oren Milman, benjamin.peterson, serhiy.storchaka
Priority:normalKeywords:

Created on2017-03-17 06:43 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
testPatches.pyOren Milman,2017-08-20 21:55a dirty script to test PR 3163
Pull Requests
URLStatusLinkedEdit
PR 687serhiy.storchaka,2017-03-17 06:43
PR 3163mergedOren Milman,2017-08-20 21:48
Messages (5)
msg289745 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2017-03-17 06:43
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 generalissue28261.
msg289784 -(view)Author: Oren Milman (Oren Milman)*Date: 2017-03-17 20:50
note that#15988 also left 3 changes for this issue to fix, as can beseen by searching for '29832' in the comments ofPR 668.for example, this issue should also fix the following inconsistenterror messages:>>> socket.socket(family=socket.AF_INET6).bind(('::1', -1))Traceback (most recent call last):  File "<stdin>", line 1, in <module>OverflowError: getsockaddrarg: port must be 0-65535.>>> socket.socket(family=socket.AF_INET6).bind(('::1', -1 << 1000))Traceback (most recent call last):  File "<stdin>", line 1, in <module>OverflowError: Python int too large to convert to C long
msg300608 -(view)Author: Oren Milman (Oren Milman)*Date: 2017-08-20 21:55
here is a dirty script to test my PR.the script contains tests to anything I managed to test using myWindows 10 and Ubuntu 16.04 VM, i.e. all of the changes, except forthe 'unsupported CAN protocol' message, and the changes of the codethat handles the PF_SYSTEM family.
msg303541 -(view)Author: Oren Milman (Oren Milman)*Date: 2017-10-02 15:09
Should i remove the code that i wasn't able to test from the PR, andleave such changes to someone that is able to test it?(of course, if there is some way i can do it using a VM, please pointthat out, and i would try to set up this VM.)
msg325028 -(view)Author: Benjamin Peterson (benjamin.peterson)*(Python committer)Date: 2018-09-11 16:51
New changeset735171e33486131d93865cf851c0c3d63fffd364 by Benjamin Peterson (Oren Milman) in branch 'master':closesbpo-29832: Remove "getsockaddrarg" from error messages. (GH-3163)https://github.com/python/cpython/commit/735171e33486131d93865cf851c0c3d63fffd364
History
DateUserActionArgs
2022-04-11 14:58:44adminsetgithub: 74018
2018-09-11 16:51:32benjamin.petersonsetstatus: open -> closed

nosy: +benjamin.peterson
messages: +msg325028

resolution: fixed
stage: resolved
2017-10-02 15:09:14Oren Milmansetmessages: +msg303541
2017-08-20 21:55:40Oren Milmansetfiles: +testPatches.py

messages: +msg300608
2017-08-20 21:48:27Oren Milmansetpull_requests: +pull_request3199
2017-03-17 20:50:11Oren Milmansetmessages: +msg289784
2017-03-17 06:43:50serhiy.storchakasetpull_requests: +pull_request564
2017-03-17 06:43:17serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp