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: getaddrinfo should accept port of type long
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: AndiDog_old, giampaolo.rodola, mark.dickinson, petri.lehtinen, pitrou, python-dev, sandro.tosi
Priority: normal Keywords: patch

Created on 2010-05-29 17:48 by AndiDog_old, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue8853.patch mark.dickinson, 2010-05-30 16:45
issue8853_v2.patch petri.lehtinen, 2012-12-19 14:31 review
Messages (7)
msg106726 - (view) Author: Andidog_old (AndiDog_old) Date: 2010-05-29 17:48
socket.getaddrinfo("127.0.0.1", 80L)
error: Int or String expected

I would expect getaddrinfo to convert the port number to an integer.
msg106766 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-05-30 16:45
The attached patch should fix the problem.  I'm not sure how to test it, though:  the socket module currently seems to have exactly 0 tests for socket.getaddrinfo.
msg106769 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-05-30 17:07
See issue8857 for the tests issue.
msg128250 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011-02-09 22:58
Hi Mark, would you like to write some tests about the proposed change? Antoine gave a fast look at the issue and believe it's acceptable for 2.7.
msg177743 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2012-12-19 14:31
Attached a new patch with a test case and fixed error handling.
msg177855 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-12-20 19:11
New changeset 39803c20c9bf by Petri Lehtinen in branch '2.7':
#8853: Allow port to be of type long for socket.getaddrinfo()
http://hg.python.org/cpython/rev/39803c20c9bf
msg177856 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2012-12-20 19:12
Fixed.
History
Date User Action Args
2022-04-11 14:57:01adminsetgithub: 53099
2012-12-20 19:12:14petri.lehtinensetstatus: open -> closed
resolution: fixed
messages: + msg177856

stage: patch review -> resolved
2012-12-20 19:11:22python-devsetnosy: + python-dev
messages: + msg177855
2012-12-19 14:31:31petri.lehtinensetstage: test needed -> patch review
2012-12-19 14:31:22petri.lehtinensetfiles: + issue8853_v2.patch

messages: + msg177743
2012-12-19 09:29:56petri.lehtinensetnosy: + petri.lehtinen
2011-02-09 22:58:46sandro.tosisetversions: + Python 2.7, - Python 2.6
nosy: + sandro.tosi

messages: + msg128250

stage: test needed
2010-06-01 09:36:18giampaolo.rodolasetnosy: + giampaolo.rodola
2010-05-30 17:07:27pitrousetnosy: + pitrou
messages: + msg106769
2010-05-30 16:45:37mark.dickinsonsetfiles: + issue8853.patch

nosy: + mark.dickinson
messages: + msg106766

keywords: + patch
2010-05-29 17:48:12AndiDog_oldcreate