[issue43707] onerror in tempfile has an invalid raise expression

2021-04-02 Thread Maximilian Roos
Maximilian Roos added the comment: I see @eryksun — by convention `onerror` is always called in an except block, and so having a bare `raise` outside of an explicit except block is OK. Thanks for clarifying. I'll close this. -- resolution: -> not a bug stage: -> resolved status: ope

[issue43707] onerror in tempfile has an invalid raise expression

2021-04-02 Thread Eryk Sun
Eryk Sun added the comment: > It'll still raise, given it's invalid, though not with the > exception it should be raising with... onerror() is always called to handle an exception, and `raise` will re-raise that exception. Is there a specific case where this isn't working as expected for yo

[issue43707] onerror in tempfile has an invalid raise expression

2021-04-02 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: Adding Serhiy, who added the code in question in commit e9b51c0ad81da1da11ae65840ac8b50a8521373c (GH-10320, bpo-26660, bpo-35144). -- nosy: +erlendaasland, serhiy.storchaka ___ Python tracker

[issue43707] onerror in tempfile has an invalid raise expression

2021-04-02 Thread Maximilian Roos
New submission from Maximilian Roos : The raise expression [here](https://github.com/python/cpython/blob/ad442a674ca443feec43a88a2d3671784712e550/Lib/tempfile.py#L826) isn't valid, since it isn't in an except block. It'll still raise, given it's invalid, though not with the exception it should