gh-150207: Raise MemoryError on tokenizer allocation failure instead of crashing#150275
gh-150207: Raise MemoryError on tokenizer allocation failure instead of crashing#150275grantlouisherman wants to merge 3 commits into
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
This seems reasonable to me. One thing that's important is that any callers of these that try to recover from an allocation error know that there's a py exception to clear. In this case, I don't think there is one, just adding here in case I missed something! |
|
@pablogsal @lysnikolaou do these changes seem reasonable? |
76be14c to
37ed2a6
Compare
Signed-off-by: grantlouisherman <grantlouisherman041@gmail.com>
37ed2a6 to
55820e5
Compare
|
@grantlouisherman Hi, please don't use force push in the future, see the Dev Guide. |
|
I guess there is another missing check here: cpython/Parser/tokenizer/file_tokenizer.c Lines 379 to 381 in 540b3d0 |
…e-150207.l2BUtI.rst Co-authored-by: AN Long <aisk@users.noreply.github.com>
Original report was around this snippet of code:
Throwing a system error. Based off the write up made in #150207 I felt like there was a fair case to actually show the user a Mem error instead of a system crash.
I think this does provide a bit nicer of an experience but I think I need an actual adult to verify this for me. I also dont know the larger ramifications but it felt worth to throw something up