[issue36338] urlparse of urllib returns wrong hostname

2019-07-21 Thread jpic
Change by jpic : -- nosy: +jpic ___ Python tracker <https://bugs.python.org/issue36338> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue36338] urlparse of urllib returns wrong hostname

2019-07-21 Thread jpic
Change by jpic : -- pull_requests: +14677 pull_request: https://github.com/python/cpython/pull/14896 ___ Python tracker <https://bugs.python.org/issue36

[issue37492] should email.utils.parseaddr treat a@b. as invalid email ?

2019-07-13 Thread jpic
jpic added the comment: Thanks for the heads up. There is still one last case where maybe parseaddr should return a tuple of empty strings, currently: >>> parseaddr('a@') ('', 'a@') Is this worth changing ? -- ___

[issue37492] should email.utils.parseaddr treat a@b. as invalid email ?

2019-07-03 Thread jpic
jpic added the comment: Thanks a heap Eric, I feel a bit silly I missed it. Closing the issue as not a bug, please feel free to reopen if necessary. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracke

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-07-03 Thread jpic
jpic added the comment: Thanks for the kind words Cyril, sorry that this patch doesn't address exactly the issue that you have described initially, but rather the security issue related to it. The exception depending on the parsing issue is already supported by the new API, although

[issue37492] should email.utils.parseaddr treat a@b. as invalid email ?

2019-07-03 Thread jpic
New submission from jpic : 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 doc

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-06-03 Thread jpic
jpic added the comment: Thanks for your explanation, but in perspective with other invalid domains, such as "foo." currently resulting in an empty string too: >>> email.message_from_string('From: >>> a@foo.',policy=email.policy.default)['from&

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-06-01 Thread jpic
jpic added the comment: The email API does error recovery without loading invalid domains into the domain variable which could lead to dangerous situations, example with "a@foo.": >>> email.message_from_string('From: >>> a@foo.',policy=email.policy.defau

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-04 Thread jpic
jpic added the comment: At is allowed in the local part if quoted, the proposed patch acts within get_domain() and getdomain() and does not affect local part parsing. This still works: >>> parseaddr('"fo@bar"@bar.com') ('', '"fo@bar"

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-03 Thread jpic
jpic added the comment: The pull request has been updated to mimic net/mail's behavior rather than trying to workaround user input. Before: >>> email.message_from_string('From: a...@malicious.org@important.com', policy=email.policy.default)['from'].a

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-03 Thread jpic
jpic added the comment: I haven't found this specific case in an RFC, but checked Go's net/mail library behavior and it just considers it broken: $ cat mail.go package main import "fmt" import "net/mail" func main() { fmt.Println((&mail.Addres