Author methane
Recipients eric.snow, josh.r, methane, pablogsal, raphaelm, rhettinger, serhiy.storchaka, vstinner
Date 2020-01-07.05:38:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> 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)
>>> _csv.Dialect(S("excel"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in __hash__

You can see the MemoryError is not suppressed.
Date User Action Args
2020-01-07 05:38:42methanesetrecipients: + methane, rhettinger, vstinner, eric.snow, serhiy.storchaka, josh.r, pablogsal, raphaelm
2020-01-07 05:38:42methanesetmessageid: <>
2020-01-07 05:38:42methanelinkissue35459 messages
2020-01-07 05:38:42methanecreate