Eric V. Smith <[email protected]> added the comment:
RFC 1034 defines absolute domain names as ending with dot:
------------
When a user needs to type a domain name, the length of each label is omitted
and the labels are separated by dots ("."). Since a complete domain name ends
with the root label, this leads to a printed form which ends in a dot. We use
this property to distinguish between:
- a character string which represents a complete domain name
(often called "absolute"). For example, "poneria.ISI.EDU."
- a character string that represents the starting labels of a
domain name which is incomplete, and should be completed by
local software using knowledge of the local domain (often
called "relative"). For example, "poneria" used in the
ISI.EDU domain.
------------
I'll admit that it isn't common to specify absolute domain names, and many
resolvers treat a domain name with an internal dot, but no terminal dot, as an
absolute name.
I doubt in practice there are any email addresses that have a TLD name.
There's some bpo issue where this was discussed in reference to the ipaddress
module. I think the issues was canonicalizing names, and it was decided not to
add trailing dot to make them absolute. I realize that logic doesn't directly
apply here.
In spite of "com." being a valid domain name, I think it's reasonable to reject
it as the domain part of an email address. But there should be a comment in the
code as such.
----------
nosy: +eric.smith
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37492>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com