Title: Top-level domain names are rejected erroneously by both hostname() and domain() · Issue #442 · python-validators/validators · GitHub
Open Graph Title: Top-level domain names are rejected erroneously by both hostname() and domain() · Issue #442 · python-validators/validators
X Title: Top-level domain names are rejected erroneously by both hostname() and domain() · Issue #442 · python-validators/validators
Description: Syntactically valid, top-level domain names, with and without the final (RFC1034) dot, are rejected by validators.domain(). Syntactically valid, top-level domain names, but only with the final (RFC1034) dot, are rejected by validators.ho...
Open Graph Description: Syntactically valid, top-level domain names, with and without the final (RFC1034) dot, are rejected by validators.domain(). Syntactically valid, top-level domain names, but only with the final (RFC...
X Description: Syntactically valid, top-level domain names, with and without the final (RFC1034) dot, are rejected by validators.domain(). Syntactically valid, top-level domain names, but only with the final (RFC...
Opengraph URL: https://github.com/python-validators/validators/issues/442
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Top-level domain names are rejected erroneously by both hostname() and domain()","articleBody":"Syntactically valid, top-level domain names, with and without the final (RFC1034) dot,\nare rejected by **validators.domain()**.\n\nSyntactically valid, top-level domain names, but only with the final (RFC1034) dot,\nare rejected by **validators.hostname()**.\n\nIn each case, this is incorrect.\n\nDetails are shown in the test run recorded below.\n\n```\n$ python\nPython 3.13.1 (heads/ech:01878d639d, Dec 7 2025, 16:31:00) [GCC 13.3.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e \n\u003e\u003e\u003e from validators import __version__ as version\n\u003e\u003e\u003e from validators import domain as is_domain\n\u003e\u003e\u003e from validators import hostname as is_hostname\n\u003e\u003e\u003e from pprint import pprint\n\u003e\u003e\u003e \n\u003e\u003e\u003e version\n'0.35.0'\n\u003e\u003e\u003e \n\u003e\u003e\u003e samples = [ 'yu.', 'yu', 'yugoslavia.yu.', 'yugoslavia.yu', 'ie.', 'ie', 'defo.ie.', 'defo.ie' ]\n\u003e\u003e\u003e \n\u003e\u003e\u003e pprint(list(map(lambda x: (x, is_domain(x, rfc_1034=True)), samples)))\n[('yu.', ValidationError(func=domain, args={'value': 'yu.', 'rfc_1034': True})),\n ('yu', ValidationError(func=domain, args={'value': 'yu', 'rfc_1034': True})),\n ('yugoslavia.yu.', True),\n ('yugoslavia.yu', True),\n ('ie.', ValidationError(func=domain, args={'value': 'ie.', 'rfc_1034': True})),\n ('ie', ValidationError(func=domain, args={'value': 'ie', 'rfc_1034': True})),\n ('defo.ie.', True),\n ('defo.ie', True)]\n\u003e\u003e\u003e \n\u003e\u003e\u003e pprint(list(map(lambda x: (x, is_hostname(x, rfc_1034=True, maybe_simple=True)), samples)))\n[('yu.',\n ValidationError(func=hostname, args={'value': 'yu.', 'rfc_1034': True, 'maybe_simple': True})),\n ('yu', True),\n ('yugoslavia.yu.', True),\n ('yugoslavia.yu', True),\n ('ie.',\n ValidationError(func=hostname, args={'value': 'ie.', 'rfc_1034': True, 'maybe_simple': True})),\n ('ie', True),\n ('defo.ie.', True),\n ('defo.ie', True)]\n\u003e\u003e\u003e \n```","author":{"url":"https://github.com/niallor","@type":"Person","name":"niallor"},"datePublished":"2025-12-20T18:34:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/442/validators/issues/442"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:39752daa-3953-f309-baa4-eb3d45584502 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E836:103280:19A0C9E:2232F03:698D90AB |
| html-safe-nonce | ea5d64e52b873116daaecf1999e100c6ab59b4ce7482ddbc1422da89a7d53adc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODM2OjEwMzI4MDoxOUEwQzlFOjIyMzJGMDM6Njk4RDkwQUIiLCJ2aXNpdG9yX2lkIjoiODg5NzI5ODE2MDE2ODA0Njc2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d669e6611ba86e312a467c7b201b440d424fdbcf4fb0c52d1a57e91708b8cd8e |
| hovercard-subject-tag | issue:3750299993 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-validators/validators/442/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8fdbdddf9fe8d4e8dd48ab614498f80bf25c021900920b307907524be69996a6/python-validators/validators/issues/442 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8fdbdddf9fe8d4e8dd48ab614498f80bf25c021900920b307907524be69996a6/python-validators/validators/issues/442 |
| og:image:alt | Syntactically valid, top-level domain names, with and without the final (RFC1034) dot, are rejected by validators.domain(). Syntactically valid, top-level domain names, but only with the final (RFC... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | niallor |
| hostname | github.com |
| expected-hostname | github.com |
| None | c0818105fa276287e9369cfdefa0a0fa7953719791ceff9b94d69623c0a4fe8a |
| turbo-cache-control | no-preview |
| go-import | github.com/python-validators/validators git https://github.com/python-validators/validators.git |
| octolytics-dimension-user_id | 113113270 |
| octolytics-dimension-user_login | python-validators |
| octolytics-dimension-repository_id | 13642984 |
| octolytics-dimension-repository_nwo | python-validators/validators |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 13642984 |
| octolytics-dimension-repository_network_root_nwo | python-validators/validators |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bd964b0594af16531b06ac03e14711206a3079aa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width