[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-06-26 Thread Claudiu Saftoiu
New submission from Claudiu Saftoiu: I'm processing Yahoo! Groups backup archives, and came across an email message which causes the `.get_payload(decode=True)` step to raise an AssertionError. Particularly, the following exception is raised in `lib/python3.5/email/_encoded_words.py`,

[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2016-06-26 Thread Claudiu Saftoiu
Claudiu Saftoiu added the comment: See attached another file with more test cases. -- Added file: http://bugs.python.org/file43557/bugreport_moretests.py ___ Python tracker <http://bugs.python.org/issue27

[issue27565] Offer error context manager for code.interact

2016-07-18 Thread Claudiu Saftoiu
New submission from Claudiu Saftoiu: When debugging code that raises unexpected exceptions, I often find myself doing this: try: some_code except: import code; code.interact(local=locals()) raise My suggestion is a context manager to make this less verbose

[issue27678] itertools.permutations/.combinations should have len

2016-08-04 Thread Claudiu Saftoiu
New submission from Claudiu Saftoiu: Right now, itertools.permutations and itertools.combinations and itertools.product objects don't have a `len`. >>> len(itertools.combinations(range(10), 5)) Traceback (most recent call last): File "", line 1, in T

[issue27678] itertools.permutations/.combinations should have len

2016-08-04 Thread Claudiu Saftoiu
Claudiu Saftoiu added the comment: Ahh, I see. In that case, if the object passed-in has a length, use that. If not, then raise TypeError. e.g. proposed behavior: >>> len(itertool.combinations(range(10), 2)) 45 >>> len(itertool.combinations(iter(range(10)),