[issue46517] Review exception handling in urllib

2022-01-25 Thread Irit Katriel
Irit Katriel added the comment: > The author probably also wants the TypeError initially raised from the > "len(query)" and "query[0]" operations to get the same "not a valid . . ." > message. I see. I didn’t realise it’s deprecated, I guess we’ll leave it alone then. Thanks. --

[issue46517] Review exception handling in urllib

2022-01-25 Thread Martin Panter
Martin Panter added the comment: The linked code is for urllib.parse.urlencode, looking something like try: if len(query) and not isinstance(query[0], tuple): raise TypeError except TypeError: ty, va, tb = sys.exc_info() raise TypeError("not a valid non-string sequence "

[issue46517] Review exception handling in urllib

2022-01-25 Thread Irit Katriel
Irit Katriel added the comment: Note that test.support has special handling for urllib's nested exception structure: https://github.com/python/cpython/blob/3.10/Lib/test/support/socket_helper.py#L250 -- ___ Python tracker

[issue46517] Review exception handling in urllib

2022-01-25 Thread Irit Katriel
Change by Irit Katriel : -- title: Review exception handling in urllib.parse -> Review exception handling in urllib ___ Python tracker ___