t.n.common.extractRecord ineffectually checks for socket.inet_ntop
Open
Nobody has claimed this yet.
bug
names
new
priority-low
- Dominant language
- Python
- Stars
- 6k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 10
Description
| @twm reported | |
|---|---|
| Trac ID | trac#9753 |
| Type | defect |
| Created | 2020-01-08 04:39:47Z |
From twisted.names.common.extractRecord():
if hasattr(socket, 'inet_ntop'):
for r in answers:
if r.name == name and r.type == dns.A6:
return socket.inet_ntop(socket.AF_INET6, r.payload.address)
for r in answers:
if r.name == name and r.type == dns.AAAA:
return socket.inet_ntop(socket.AF_INET6, r.payload.address)
for r in answers:
if r.name == name and r.type == dns.A:
return socket.inet_ntop(socket.AF_INET, r.payload.address)
The hasattr() check is ineffectual for two reasons:
twisted.python.compatmonkeypatches this method, so it is always present.- The processing of A records uses this function outside the block protected by the check.
Remove the check.
Searchable metadata
trac-id__9753 9753
type__defect defect
reporter__twm twm
priority__low low
milestone__None None
branch__
branch_author__
status__new new
resolution__None None
component__names names
keywords__None None
time__1578458387989425 1578458387989425
changetime__1578458387989425 1578458387989425
version__None None
owner__None None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at twisted.names.common.extractRecord(), where the issue identifies the ineffective socket.inet_ntop check. Remove that check, then inspect the existing tests covering A, A6, and AAAA records to verify the lookup behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100