[issue28406] Possible PyUnicode_InternInPlace() edge-case bug

2016-10-10 Thread INADA Naoki
INADA Naoki added the comment: I think the comment described "Why Py_ALLOW_RECURSION is required", not "t may be NULL even if s is in the intern dict". > If PyDict_GetItem fails due to stack overflow, perhaps the Python process is > doomed to fail soon anyway. When I changed the code to use P

[issue28406] Possible PyUnicode_InternInPlace() edge-case bug

2016-10-10 Thread Larry Hastings
Larry Hastings added the comment: Ah, indeed. My mistake--I'm working in the Gilectomy branch, which is hilariously out of date. (It's stuck in February 2016.) The new version using PyDict_SetDefault() won't have *this* specific problem. Perhaps later I'll read the new code and see if I can

[issue28406] Possible PyUnicode_InternInPlace() edge-case bug

2016-10-10 Thread Xiang Zhang
Xiang Zhang added the comment: The code has already been changed in #27454. -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bu

[issue28406] Possible PyUnicode_InternInPlace() edge-case bug

2016-10-10 Thread Larry Hastings
New submission from Larry Hastings: A visual inspection of PyUnicode_InternInPlace() suggests there might be a rare edge-case bug lurking there. Specifically, the bug has to do with "interned mortal" strings. Interned mortal strings are stored in the static "interned" dictionary, with their k