[issue19257] Sub-optimal error message when importing a non-package

2020-03-06 Thread Brett Cannon
Brett Cannon added the comment: I'm going to make a call and say the chained exception should stay. If people want to start the discussion again they can. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___

[issue19257] Sub-optimal error message when importing a non-package

2014-03-14 Thread Éric Araujo
Éric Araujo added the comment: That makes a lot of sense. I guess this is Brett’s call. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19257 ___

[issue19257] Sub-optimal error message when importing a non-package

2014-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: If you only had the latter exception all you would know is Python doesn't consider datetime a package but you wouldn't know why that is unless you knew the exact definition (the __path__ attribute exists). Having the former exception helps make that a bit

[issue19257] Sub-optimal error message when importing a non-package

2014-03-14 Thread R. David Murray
R. David Murray added the comment: Antoine: down that path lies Microsoft's An error has occurred error messages. The point of the extra information is not to inform the end user, it is to make it possible for an expert to solve the problem, and for it to be findable in a web search. Now,

[issue19257] Sub-optimal error message when importing a non-package

2014-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Antoine: down that path lies Microsoft's An error has occurred error messages. The point of the extra information is not to inform the end user, it is to make it possible for an expert to solve the problem, and for it to be findable in a web search. I

[issue19257] Sub-optimal error message when importing a non-package

2014-03-13 Thread Éric Araujo
Éric Araujo added the comment: Fix is simple: --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -1519,7 +1519,7 @@ def _find_and_load_unlocked(name, import path = parent_module.__path__ except AttributeError: msg = (_ERR_MSG + '; {} is not

[issue19257] Sub-optimal error message when importing a non-package

2014-03-13 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- keywords: +needs review, patch stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19257 ___

[issue19257] Sub-optimal error message when importing a non-package

2014-03-13 Thread STINNER Victor
STINNER Victor added the comment: --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py Eric, please attach the patch as a file to the issue, so it can be easily reviewed on Rietveld. -- nosy: +haypo ___ Python tracker

[issue19257] Sub-optimal error message when importing a non-package

2014-03-13 Thread Éric Araujo
Éric Araujo added the comment: I figured it would take less time for someone to go to the file and make the edit than download and apply a patch file, but as you wish :) -- Added file: http://bugs.python.org/file34392/fix-import-not-package-tb.diff

[issue19257] Sub-optimal error message when importing a non-package

2014-03-13 Thread STINNER Victor
STINNER Victor added the comment: I figured it would take less time for someone to go to the file and make the edit than download and apply a patch file, but as you wish :) It's not to apply the patch, but to review it. The Rietveld tool helps to review a patch online, it displays more

[issue19257] Sub-optimal error message when importing a non-package

2014-03-13 Thread Brett Cannon
Brett Cannon added the comment: Is it confusing though? If you only had the latter exception all you would know is Python doesn't consider datetime a package but you wouldn't know why that is unless you knew the exact definition (the __path__ attribute exists). Having the former exception

[issue19257] Sub-optimal error message when importing a non-package

2014-03-13 Thread Éric Araujo
Éric Araujo added the comment: If you only had the latter exception all you would know is Python doesn't consider datetime a package but you wouldn't know why that is Well, I’d be satisfied with that. Looking at the doc or importing just datetime would let me know it’s a module, not a

[issue19257] Sub-optimal error message when importing a non-package

2014-03-13 Thread R. David Murray
R. David Murray added the comment: That's only true if you are dealing with files and directories though. The import system can deal with much more than that, in which case the absence __path__ could be an important bit of debugging information. -- nosy: +r.david.murray

[issue19257] Sub-optimal error message when importing a non-package

2014-03-13 Thread R. David Murray
R. David Murray added the comment: Actually, it could be important even if you are dealing with files and directories (or I'm confused and __path__ is always about same :), since you could be dealing with an alternate loader. Our policy is not to hide the chained traceback unless *all* of the

[issue19257] Sub-optimal error message when importing a non-package

2013-10-14 Thread Alex Gaynor
New submission from Alex Gaynor: Use case: Alexanders-MacBook-Pro:pypy alex_gaynor$ python3.3 Python 3.3.2 (default, May 29 2013, 14:03:57) [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin Type help, copyright, credits or license for more information. import datetime.datetime

[issue19257] Sub-optimal error message when importing a non-package

2013-10-14 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +brett.cannon, eric.snow versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19257 ___