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: github.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:3302459a-ec74-193f-fea1-46581cd07fc5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D32A:B6D87:666E40:85E8F0:698E8F85 |
| html-safe-nonce | 116ce9b1b8f8022b354a8fed847e1dd236f2a26631368c16ed5259b9baf0a68c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzJBOkI2RDg3OjY2NkU0MDo4NUU4RjA6Njk4RThGODUiLCJ2aXNpdG9yX2lkIjoiODY5MTY3NzgxMjA1Mjg4OTQ3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a69982d4f3e9a625b7de55580baad13da1367323c65bac6b053212e47f3829ea |
| 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 | cb2828a801ee6b7be618f3ac76fbf55def35bbc30f053a9c41bf90210b8b72ba |
| 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 | e6b91a7e6e46287d26887e3fb7a4161657bab8f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width