Message373667
Your suggestion is correct.
A side issue is that the line numbers in the traceback are correct but the quoted text lines from iomenu (and only iomenu) are wrong, being from the line previous. I will have to investigate this discrepancy.
After the patch, two weeks ago, for #41158, iomenu line 199 in save is
if self.writefile(self.filename):
line 232 in writefile is
chars = self.encode(text)
line 291 in encode is
enc, _ = tokenize.detect_encoding(io.BytesIO(encoded).readline)
This is only tried if ascii encoding fails and require the addition of 'import io'.
Before I close this, I will try to add a unittest that similarly fails without the import added, as well as some others for other exit points. |
|
Date |
User |
Action |
Args |
2020-07-15 04:43:51 | terry.reedy | set | recipients:
+ terry.reedy, nirinA raseliarison |
2020-07-15 04:43:51 | terry.reedy | set | messageid: <1594788231.91.0.0775920819953.issue41300@roundup.psfhosted.org> |
2020-07-15 04:43:51 | terry.reedy | link | issue41300 messages |
2020-07-15 04:43:51 | terry.reedy | create | |
|