Message359489
> I've tried writing some Python code to reproduce this bug, but I'm unable to -- I should be missing something. Is there a simple snippet showing the issue?
Note that this is a bug from long ago. Why this bug had lived long is it can not happen in regular cases. So it is difficult to reproduce.
See PR 11112. _csv module is changed to use PyDict_GetItemWithError.
Let's try it on Python 3.7.
Python 3.7.6 (default, Dec 30 2019, 19:38:28)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class S(str):
... def __hash__(self):
... raise MemoryError
...
>>> import _csv
>>> _csv.Dialect(S("excel"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
_csv.Error: unknown dialect
You can see the MemoryError is suppressed. Let's try it on Python 3.8.
$ python3
Python 3.8.1 (default, Jan 6 2020, 16:02:33)
(snip)
>>> _csv.Dialect(S("excel"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in __hash__
MemoryError
You can see the MemoryError is not suppressed. |
|
| Date |
User |
Action |
Args |
| 2020-01-07 05:38:42 | methane | set | recipients:
+ methane, rhettinger, vstinner, eric.snow, serhiy.storchaka, josh.r, pablogsal, raphaelm |
| 2020-01-07 05:38:42 | methane | set | messageid: <[email protected]> |
| 2020-01-07 05:38:42 | methane | link | issue35459 messages |
| 2020-01-07 05:38:42 | methane | create | |
|