Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for idna tr domains #245

Merged
merged 7 commits into from
Nov 17, 2024

Conversation

ofaruk89
Copy link

@ofaruk89 ofaruk89 commented Oct 10, 2024

.tr domains not need Punycode conversion, if you convert them they will not be able to get whois information.

CODE
`domain_info = whois.whois("s-vasıta.com.tr")
print(domain_info)

`
OUTPUT BEFORE FIX

{ "domain_name": null, "creation_date": null, "expiration_date": null, "frozen_status": null, "status": null, "name_servers": null, "registrant_name": null, "admin": null, "admin_organization": null, "admin_address": null, "admin_phone": null, "admin_fax": null, "tech": null, "tech_organization": null, "tech_address": null, "tech_phone": null, "tech_fax": null, "billing": null, "billing_organization": null, "billing_address": null, "billing_phone": null, "billing_fax": null }
AFTER FIX

{ "domain_name": "s-vasıta.com.tr", "creation_date": "2022-09-14 00:00:00", "expiration_date": "2025-09-13 00:00:00", "frozen_status": "-", "status": "The domain is LOCKED to transfer.", "name_servers": "ns1.ihsdnsx8.com\nns2.ihsdnsx8.com", "registrant_name": "Sahibinden Bilgi Teknolojileri Pazarlama ve Ticaret A.Ş.\n Hidden upon user request\n Hidden upon user request\n Hidden upon user request", "admin": null, "admin_organization": null, "admin_address": null, "admin_phone": null, "admin_fax": null, "tech": null, "tech_organization": null, "tech_address": null, "tech_phone": null, "tech_fax": null, "billing": null, "billing_organization": null, "billing_address": null, "billing_phone": null, "billing_fax": null }

whois/whois.py Outdated Show resolved Hide resolved
@richardpenman
Copy link
Owner

There might be other TLDs that want to disable punycode conversion. Instead of hardcoding this for TR could you add a convert_punycode flag with the default set to True?

@ofaruk89
Copy link
Author

There might be other TLDs that want to disable punycode conversion. Instead of hardcoding this for TR could you add a convert_punycode flag with the default set to True?

okay i will set, give me a few minute

@ofaruk89
Copy link
Author

Its okay

@richardpenman
Copy link
Owner

nice work, thanks for that!

Apparently this breaks some of the test cases due to text / bytes encoding:
https://github.com/richardpenman/whois/actions/runs/11615445257/job/32367304331?pr=245
Would you be able to look at that? You can run tests locally with python -m pytest.

@ofaruk89
Copy link
Author

ofaruk89 commented Nov 1, 2024

nice work, thanks for that!

Apparently this breaks some of the test cases due to text / bytes encoding: https://github.com/richardpenman/whois/actions/runs/11615445257/job/32367304331?pr=245 Would you be able to look at that? You can run tests locally with python -m pytest.

fix is ready

@richardpenman richardpenman merged commit a493897 into richardpenman:master Nov 17, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants