[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 3.5 and 3.6 are in security fixes only mode, and this issue is not a security issue. After merging PR 19484 I cannot reproduce the original issue anymore. I left this issue open for the case if I find a way to write tests for the merged changes. -

[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ee249d798ba08f065efbf4f450880a446c6ca49d by Serhiy Storchaka in branch '3.8': [3.8] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19483) https://github.com/python/cpython/commit/ee249d798ba08f065efbf4f450880a446c6

[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4057e8f9b56789223a1e691d7601003aceb84ad1 by Serhiy Storchaka in branch '3.7': [3.7] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19484) https://github.com/python/cpython/commit/4057e8f9b56789223a1e691d7601003aceb

[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18837 pull_request: https://github.com/python/cpython/pull/19484 ___ Python tracker ___

[issue40126] Incorrect error handling in unittest.mock

2020-04-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18835 pull_request: https://github.com/python/cpython/pull/19483 ___ Python tracker ___

[issue40126] Incorrect error handling in unittest.mock

2020-04-11 Thread Barry McLarnon
Barry McLarnon added the comment: Issue still exists in 3.7 and below, as it was part of a different function before. Current PR doesn't resolve the original issue that was raised. -- versions: +Python 3.5, Python 3.6 ___ Python tracker

[issue40126] Incorrect error handling in unittest.mock

2020-04-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4b222c9491d1700e9bdd98e6889b8d0ea1c7321e by Serhiy Storchaka in branch 'master': bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) https://github.com/python/cpython/commit/4b222c9491d1700e9bdd98e6889b8d0ea1c7321e ---

[issue40126] Incorrect error handling in unittest.mock

2020-04-03 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +cjw296, xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40126] Incorrect error handling in unittest.mock

2020-04-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18714 pull_request: https://github.com/python/cpython/pull/19351 ___ Python tracker ___

[issue40126] Incorrect error handling in unittest.mock

2020-04-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that the current code is not correct. __exit__ should not be called if __enter__ is failed. If some __enter__ implementation calls other __enter__s it should manually call corresponding __exit__s. -- nosy: +michael.foord, ncoghlan, serhiy.s

[issue40126] Incorrect error handling in unittest.mock

2020-04-03 Thread Barry McLarnon
Change by Barry McLarnon : -- components: +Library (Lib) -Tests ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue40126] Incorrect error handling in unittest.mock

2020-04-03 Thread Barry McLarnon
Barry McLarnon added the comment: After further investigation, it seems this was fixed in https://github.com/python/cpython/commit/436c2b0d67da68465e709a96daac7340af3a5238 However, this fix was as part of an unrelated changeset and in a different function in 3.8+, and was never rolled back t

[issue40126] Incorrect error handling in unittest.mock

2020-04-03 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +18701 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19338 ___ Python tracker _

[issue40126] Incorrect error handling in unittest.mock

2020-03-31 Thread Barry McLarnon
New submission from Barry McLarnon : The error handling in mock.decorate_callable (3.5-3.7) and mock.decoration_helper (3.8-3.9) is incorrectly implemented. If the error handler is triggered in the loop, the `patching` variable is out of scope and raises an unhandled `UnboundLocalError` inste