[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2020-01-23 Thread Brett Cannon
Brett Cannon added the comment: Sorry, you're right; I forgot importlib got it "right" while import got it "wrong". :) -- ___ Python tracker ___

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2020-01-22 Thread Miro Hrončok
Miro Hrončok added the comment: For the record, looking at https://docs.python.org/3.9/whatsnew/3.9.html I had an impression that this also affects regular imports, as described in https://bugzilla.redhat.com/show_bug.cgi?id=1791769#c2 -- if that's not that case, I'm sorry. Anyway, I get

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2020-01-22 Thread Brett Cannon
Brett Cannon added the comment: The problem with the hybrid exception is that importlib would then still raise a different exception from import itself, so the discrepancy would persist. And if you updated import you could then break people in another way where they were catching ValueError

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2020-01-21 Thread Miro Hrončok
Miro Hrončok added the comment: I know that raising a DeprecationWarning here is most likely not possible or too black-magical to do. My intention was not to be harsh, sorry about that. I just wanted to point out that a backwards incompatible behavior like this without a (possible)

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2020-01-21 Thread Brett Cannon
Brett Cannon added the comment: There's no deprecation warning because how do you warn about that? You raise DeprecationWarning about an exception you have yet to raise? And I personally think calling this unfair is a bit harsh. -- ___ Python

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2020-01-21 Thread Miro Hrončok
Miro Hrončok added the comment: While raising ImportError certainly makes much more sense in this case, this change is backwards incompatible and there was no DeprecationWarning. I don't consider that fair. As a certain compromise, we could maybe raise a custom ImportError+ValueError

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-08-06 Thread Brett Cannon
Change by Brett Cannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-08-02 Thread miss-islington
miss-islington added the comment: New changeset c5fa44944ee0a31a12b9a70776c7cb56c4dc39a2 by Miss Islington (bot) (Ngalim Siregar) in branch 'master': bpo-37444: Update differing exception between builtins and importlib (GH-14869)

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-07-29 Thread Joannah Nanjekye
Change by Joannah Nanjekye : -- nosy: -nanjekyejoannah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-07-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I think this should be an ImportError I also think ImportError is what people would expect when an import fails. -- nosy: +rhettinger ___ Python tracker

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-07-20 Thread Ngalim Siregar
Change by Ngalim Siregar : -- keywords: +patch pull_requests: +14657 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14869 ___ Python tracker ___

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-07-02 Thread Joannah Nanjekye
Change by Joannah Nanjekye : -- nosy: +nanjekyejoannah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-07-01 Thread Nick Coghlan
Nick Coghlan added the comment: ImportError sounds right to me. We already raise that just above this for the "no dots at all" case, so also raising it for the "not enough dots" case makes more sense than leaving them different. -- ___ Python

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-06-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-06-28 Thread Brett Cannon
Brett Cannon added the comment: import.c code raising the exception: https://github.com/python/cpython/blob/f9f8e3ce709ceb15c8db8c8dde940daf1febf13d/Python/import.c#L1675-L1677 -- ___ Python tracker

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-06-28 Thread Brett Cannon
Brett Cannon added the comment: I think this should be an ImportError and so that means builtins.__import__() is wrong. Anyone want to argue for the other side? -- ___ Python tracker

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-06-28 Thread Brett Cannon
Brett Cannon added the comment: Importllib code raising the exception is https://github.com/python/cpython/blob/f9f8e3ce709ceb15c8db8c8dde940daf1febf13d/Lib/importlib/_bootstrap.py#L874-L876 . -- ___ Python tracker

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-06-28 Thread Brett Cannon
New submission from Brett Cannon : builtins.__import__() raises ValueError (as it did in Python 2.7) while importlib.__import__() raises ImportError (which makes more sense to me). Found by Ben Lewis. -- components: Interpreter Core, Library (Lib) messages: 346855 nosy: Ben Lewis2,