[issue12583] More detailed ImportError messages

2013-01-25 Thread Brett Cannon
Brett Cannon added the comment: Closing as circular imports are not as much of a problem in Python 3.3, ImportError now has informational attributes, and namespace packages took care of the usefulness of ImportWarning. -- assignee: -> brett.cannon resolution: -> out of date status: o

[issue12583] More detailed ImportError messages

2011-07-21 Thread Ram Rachum
Ram Rachum added the comment: Thanks for explaining, I guess it's too complicated. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue12583] More detailed ImportError messages

2011-07-20 Thread Brett Cannon
Brett Cannon added the comment: For the ImportWarning docs, there could stand to be more; patches welcome. =) As for ImportError being postmortem on an error, that is not always true as plenty of people use the trick, e.g.: try: import json except ImportError: import simplejson as json As fo

[issue12583] More detailed ImportError messages

2011-07-20 Thread R. David Murray
R. David Murray added the comment: It might. Although I did miss your message about the flag, my point really was that you'll find that import is very complicated when you try to write the patch to do it. There may not be one central place you can set and query that flag, because of the var

[issue12583] More detailed ImportError messages

2011-07-20 Thread Ram Rachum
Ram Rachum added the comment: David, I don't think you've read my message carefully enough. I'm well aware that there are other ways in Python to import than the `import` statement. I'm proposing that it doesn't matter. I asked, "isn't a circular import when you try to import a module `foo` w

[issue12583] More detailed ImportError messages

2011-07-19 Thread R. David Murray
R. David Murray added the comment: Yes, there are ways other than an import statement that a module can get imported (the __import__ function, for example, and the imp module for another, as well as importlib). If you want to try your hand at writing a patch to do the post mortem you will di

[issue12583] More detailed ImportError messages

2011-07-19 Thread Ram Rachum
Ram Rachum added the comment: Brett, I checked out the two pieces of documentation you referred to, they have very little information about ImportWarning other than "Base class for warnings about probable mistakes in module imports." -- ___ Python

[issue12583] More detailed ImportError messages

2011-07-19 Thread Ram Rachum
Ram Rachum added the comment: Brett: Why does it matter that it will be costly? It's a post-mortem activity anyway, usually done when something critical failed and the entire system isn't working. Why would functions need to be looked at? I mean, isn't a circular import when you try to impor

[issue12583] More detailed ImportError messages

2011-07-19 Thread Eric Snow
Changes by Eric Snow : -- nosy: +ericsnow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue12583] More detailed ImportError messages

2011-07-19 Thread Brett Cannon
Brett Cannon added the comment: Doing a stack walk to try to determine if an import failure was from a circular import would be costly, a little complicated (since you cannot simply look at import statements but also various kinds of functions that can do an equivalent job of importing) and p

[issue12583] More detailed ImportError messages

2011-07-19 Thread Éric Araujo
Éric Araujo added the comment: Just a side note: please don’t use “folder” for cross-platform code or documentation, it’s a Windows-specific term (like “wizard” for example). -- nosy: +eric.araujo title: More detailed `ImportError` messages -> More detailed ImportError messages _

[issue12583] More detailed `ImportError` messages

2011-07-18 Thread Ram Rachum
Ram Rachum added the comment: What's the problem with detecting circular imports? Mind you that we only need a post-mortem analysis to check why the import failed; so after the import failed, we could check whether our import stack has a loop in it. I'm not familiar with the ImportWarning reg

[issue12583] More detailed `ImportError` messages

2011-07-18 Thread Brett Cannon
Brett Cannon added the comment: The problem with this request is it is practically unworkable. For instance, the missing __init__.py already exists as an ImportWarning. The circular import is a problem as Python would have to detect circular imports which is hard, else we would have a circula

[issue12583] More detailed `ImportError` messages

2011-07-18 Thread Ram Rachum
Ram Rachum added the comment: As long as those attributes are reflected in the string in human language, why not. -- ___ Python tracker ___

[issue12583] More detailed `ImportError` messages

2011-07-18 Thread Brian Curtin
Brian Curtin added the comment: Rather than mucking with the string, we should probably set some of these details as attributes on ImportError. #10854 wanted something similar - details on the pyd file that failed if you get an ImportError on an extension module on Windows. -- nosy:

[issue12583] More detailed `ImportError` messages

2011-07-18 Thread Ram Rachum
New submission from Ram Rachum : I've been frustrated so many times by `ImportError: cannot import name foo`. Right now I'm debugging some problem on a PAAS server (with no SSH access), and the server returns a traceback of `cannot import name foo`, and I don't have any idea what it means. It