New submission from jpic <j...@yourlabs.org>: Following up bpo-34155[0] PR#13079[1], which changes:
>>> parseaddr('a@malicious@good') >From returning: ('', 'a@malicious') To return: ('', '') As such, parseaddr behaves more like documented: email.utils.parseaddr(address) Parse address – which should be the value of some address-containing field such as To or Cc – into its constituent realname and email address parts. Returns a tuple of that information, unless the parse fails, in which case a 2-tuple of ('', '') is returned. The pull request discussion suggested that it would be good to open a new bpo to discuss changing the following behaviour: parseaddr('a@b.') >From returning: ('', 'a@b.') To return a tuple of empty strings as well. We have not found RFC to back up that `a@b.` was not a valid email, however RFC 1034 states that dots separate labels: When a user needs to type a domain name, the length of each label is omitted and the labels are separated by dots ("."). As such, my understanding is that a valid domain must not end with a dot. [0] https://bugs.python.org/issue34155 [1] https://github.com/python/cpython/pull/13079 ---------- components: email messages: 347207 nosy: barry, jpic, r.david.murray priority: normal severity: normal status: open title: should email.utils.parseaddr treat a@b. as invalid email ? type: behavior _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37492> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com