[issue15767] add ModuleNotFoundError

2018-02-27 Thread Christoph Groth
Christoph Groth added the comment: Unfortunately I do not feel competent enough to submit a documentation patch because I still do not understand why ModuleNotFoundError was added. I don't want to bother you further with this. Thank you all for your prompt replies.

[issue15767] add ModuleNotFoundError

2018-02-27 Thread Ned Deily
Ned Deily added the comment: Christoph, thanks for your suggestion. If you think the documentation needs improving, please open a new issue with any suggested wording (or, even better, a doc PR). This issue (issue15767) has long been closed and any discussion here is

[issue15767] add ModuleNotFoundError

2018-02-27 Thread Christoph Groth
Christoph Groth added the comment: Thank you, Chris, for your reply. If this is indeed the main use case of ModuleNotFoundError, I respectfully suggest to document it better. The way things are now, Python users who switch to 3.6 encounter this new exception

[issue15767] add ModuleNotFoundError

2018-02-27 Thread Chris Jerdonek
Chris Jerdonek added the comment: Eric touched on the use when he said the following above: > It's nice to be able to distinguish between the failure to *find* the module > during import from other uses of ImportError. To make up one example, you might want to use a

[issue15767] add ModuleNotFoundError

2018-02-26 Thread Christoph Groth
Christoph Groth added the comment: In the above, please replace "understand the decision" by "understand the usefulness of it". In the above discussion, as an alternative to a new exception, it was proposed to add an attribute to ImportError ('reason'), but then

[issue15767] add ModuleNotFoundError

2018-02-26 Thread Christoph Groth
Christoph Groth added the comment: My curiosity was piqued when I saw ModuleNotFoundError, so I decided to look it up. This led me to this page and I read the complete discussion. I still did not understand the decision, so I allowed myself to ask, also because I

[issue15767] add ModuleNotFoundError

2018-02-26 Thread Guido van Rossum
Guido van Rossum added the comment: I don't like the way you're asking questions here. If you're interested just as a historian of the language, it will have to wait. If you're questioning the decision, please come out and say so. --

[issue15767] add ModuleNotFoundError

2018-02-26 Thread Christoph Groth
Christoph Groth added the comment: > Read Eric's message before mine. Of course I read it, I wouldn't have asked otherwise. Eric mentions an older message ("see msg182332") that *predates* your judgment that "outside importlib there shouldn't be a need to

[issue15767] add ModuleNotFoundError

2018-02-26 Thread Guido van Rossum
Guido van Rossum added the comment: Read Eric's message before mine. -- ___ Python tracker ___

[issue15767] add ModuleNotFoundError

2018-02-26 Thread Christoph Groth
Christoph Groth added the comment: I'm trying to understand why ModuleNotFoundError was added to 3.6. The "what's new" entry links to this page. Looking at the discussion, Guido said in 2013: "Right. Outside importlib there shouldn't be a need to distinguish

[issue15767] add ModuleNotFoundError

2016-09-07 Thread Eric Snow
Changes by Eric Snow : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue15767] add ModuleNotFoundError

2016-09-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 90549c3c609c by Eric Snow in branch 'default': Issue #15767: Add ModuleNotFoundError. https://hg.python.org/cpython/rev/90549c3c609c New changeset 5fdb8c897023 by Eric Snow in branch 'default': Issue #15767: Use ModuleNotFoundError.

[issue15767] add ModuleNotFoundError

2016-09-07 Thread Guido van Rossum
Guido van Rossum added the comment: +1 to add this to 3.6b1. -- ___ Python tracker ___ ___ Python-bugs-list

[issue15767] add ModuleNotFoundError

2016-09-07 Thread Eric Snow
Changes by Eric Snow : -- assignee: brett.cannon -> eric.snow resolution: rejected -> stage: -> needs patch status: closed -> open versions: +Python 3.6 -Python 3.4 ___ Python tracker

[issue15767] add ModuleNotFoundError

2014-05-25 Thread Eric Snow
Eric Snow added the comment: Any chance we could revive ModuleNotFoundError? It's nice to be able to distinguish between the failure to *find* the module during import from other uses of ImportError. I'd definitely expect it to work the way Guido explained. Basically only

[issue15767] add ModuleNotFoundError

2013-07-05 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___ Python-bugs-list mailing list

[issue15767] add ModuleNotFoundError

2013-07-04 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- dependencies: +Update stdlib to use ModuleNotFoundError ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___

[issue15767] add ModuleNotFoundError

2013-07-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0e4e062751fa by Brett Cannon in branch 'default': Issue #15767: Back out 8d28d44f3a9a related to ModuleNotFoundError. http://hg.python.org/cpython/rev/0e4e062751fa New changeset e3ec8b176a80 by Brett Cannon in branch 'default': Issue #15767: Revert

[issue15767] add ModuleNotFoundError

2013-07-04 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___

[issue15767] add ModuleNotFoundError

2013-07-03 Thread Eric Snow
Eric Snow added the comment: I'm sorry, but this seems like it should be an importlib internal affair. The new exception is too much in everyone's face, because the exception name gets printed on every traceback. That's the crux of the issue. If there isn't much utility outside importlib

[issue15767] add ModuleNotFoundError

2013-07-03 Thread Guido van Rossum
Guido van Rossum added the comment: Right. Outside importlib there shouldn't be a need to distinguish between the cases (especially given that the exception works differently than its name suggests). -- ___ Python tracker rep...@bugs.python.org

[issue15767] add ModuleNotFoundError

2013-07-02 Thread Thomas Heller
Changes by Thomas Heller thel...@ctypes.org: -- nosy: +theller ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___ Python-bugs-list

[issue15767] add ModuleNotFoundError

2013-07-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If most user code should catch a ModuleNotFoundError exception, perhaps it will be better rename old ImportError to ImportlibError (or ImportingError, or ImportMachineryError, or BaseImportError) and new ModuleNotFoundError to ImportError. This will left

[issue15767] add ModuleNotFoundError

2013-07-02 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 02, 2013, at 07:16 AM, Serhiy Storchaka wrote: If most user code should catch a ModuleNotFoundError exception, perhaps it will be better rename old ImportError to ImportlibError (or ImportingError, or ImportMachineryError, or BaseImportError) and new

[issue15767] add ModuleNotFoundError

2013-07-02 Thread Brett Cannon
Brett Cannon added the comment: OK, I'll revert the changes related to ModuleNotFoundError. As for adding a 'reason' attribute, I see two sticking points. One is how to set the enum value. There is both the C code issue (specifically so ceval.c and import.c can use the values) as well as

[issue15767] add ModuleNotFoundError

2013-07-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: But the bootstrapping issues for the enum module is probably going to be the showstopper for this. Have we succumbed to the enum religion already? Just make it a plain string. -- ___ Python tracker

[issue15767] add ModuleNotFoundError

2013-07-02 Thread Brett Cannon
Brett Cannon added the comment: In this instance where there are only a set number of options are expected to be officially valid, yes I think enums are a good fit. As for strings, the only way I would be okay with that is defining the strings either as attributes on ImportError itself or off

[issue15767] add ModuleNotFoundError

2013-07-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: In this instance where there are only a set number of options are expected to be officially valid, yes I think enums are a good fit. They are a good fit, that doesn't mean they're the only one. As for strings, the only way I would be okay with that is

[issue15767] add ModuleNotFoundError

2013-07-02 Thread Brett Cannon
Brett Cannon added the comment: It's not a question of harder but more error-prone since a typo in the string won't be directly noticed while mistyping an attribute name will be. -- ___ Python tracker rep...@bugs.python.org

[issue15767] add ModuleNotFoundError

2013-07-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: It's not a question of harder but more error-prone since a typo in the string won't be directly noticed while mistyping an attribute name will be. Ok, agreed. I guess it's ok, if it only adds one or two attributes. --

[issue15767] add ModuleNotFoundError

2013-07-01 Thread Brett Cannon
Brett Cannon added the comment: Obviously no worries for opening this up again; if something isn't clear better to get it sorted out now rather than after 3.4 is out that door. So I see two questions: why isn't ImportError being raised in the ``import re.bogus`` case and why the subtle

[issue15767] add ModuleNotFoundError

2013-07-01 Thread Guido van Rossum
Guido van Rossum added the comment: Ok, the history of all that makes sense, except now I wonder if ModuleNotFoundError is useful at all. I just reviewed a patch for 3.4 and in the latest revision all ImportError checks were replaced with ModuleNotFoundError checks. What purpose does that

[issue15767] add ModuleNotFoundError

2013-07-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le lundi 01 juillet 2013 à 16:54 +, Brett Cannon a écrit : As for the ``import re.bogus`` case not raising ModuleNotFoundError, I'm fine with changing it. +1. -- ___ Python tracker rep...@bugs.python.org

[issue15767] add ModuleNotFoundError

2013-07-01 Thread Brett Cannon
Brett Cannon added the comment: The impetus of ModuleNotFoundError is the need for something similar in importlib thanks to ``from ... import``. When you do something like __import__('os', fromlist=['path']), any ImportError must be silenced **if** it relates only to the fact that the module

[issue15767] add ModuleNotFoundError

2013-07-01 Thread Guido van Rossum
Guido van Rossum added the comment: [switching to gmail-powered account] I'm sorry, but this seems like it should be an importlib internal affair. The new exception is too much in everyone's face, because the exception name gets printed on every traceback. I like #4, #3 is also acceptable.

[issue15767] add ModuleNotFoundError

2013-06-30 Thread Guido van Rossum
Guido van Rossum added the comment: Hey Brett, Sorry for reopening this issue. I am confused by the spec for ModuleNotFoundError. Look at this (in a pretty recent repo): $ ./python.exe Python 3.4.0a0 (default:8f22e03f5f07, Jun 27 2013, 08:49:16) [GCC 4.2.1 Compatible Apple Clang 4.0

[issue15767] add ModuleNotFoundError

2013-06-12 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- title: add ImportNotFoundError - add ModuleNotFoundError ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___

[issue15767] add ModuleNotFoundError

2013-06-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8a0ed9f63c6e by Brett Cannon in branch 'default': Issue #15767: Introduce ModuleNotFoundError, a subclass of http://hg.python.org/cpython/rev/8a0ed9f63c6e -- nosy: +python-dev ___ Python tracker

[issue15767] add ModuleNotFoundError

2013-06-12 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- resolution: - fixed stage: test needed - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___

[issue15767] add ModuleNotFoundError

2013-06-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3a50025f1900 by Brett Cannon in branch 'default': Issue #15767: Touch up ModuleNotFoundError usage by import. http://hg.python.org/cpython/rev/3a50025f1900 -- ___ Python tracker rep...@bugs.python.org

[issue15767] add ModuleNotFoundError

2013-06-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset c6c0faaf65d7 by Brett Cannon in branch 'default': Issue #15767: Add an explicit test for raising ModuleNotFoundError http://hg.python.org/cpython/rev/c6c0faaf65d7 -- ___ Python tracker

[issue15767] add ModuleNotFoundError

2013-02-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've lost track of why this new exception was needed. Could someone provide a summary? Thanks :-) -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767

[issue15767] add ModuleNotFoundError

2013-02-18 Thread Michele Orrù
Changes by Michele Orrù maker...@gmail.com: -- nosy: -maker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___ Python-bugs-list mailing

[issue15767] add ModuleNotFoundError

2013-02-18 Thread Brett Cannon
Brett Cannon added the comment: TL;DR for Antoine: when using a fromlist, import failures from that list are silently ignored. Because ImportError is overloaded in terms of what it means (e.g. bag magic number, module not found) there needs to be a clean way to tell the import failed because

[issue15767] add ModuleNotFoundError

2013-02-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: from foo import bar Here bar can be not module, but an attribute of foo (for example, os.path). Serhiy: What exception is raised in that situation is controlled by the eval loop, not importlib so that would be a separate change. Just to clarify from this

[issue15767] add ModuleNotFoundError

2013-02-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: from foo import bar Here bar can be not module, but an attribute of foo (for example, os.path). What error will be raised in this case? Module or attribute - this is an implementation detail; why do we distinguish between these cases? -- nosy:

[issue15767] add ModuleNotFoundError

2013-02-17 Thread Brett Cannon
Brett Cannon added the comment: Eric: knock yourself out. =) Serhiy: What exception is raised in that situation is controlled by the eval loop, not importlib so that would be a separate change. But regardless, there is no way to infer whether you expected an attribute or module to be there,

[issue15767] add ModuleNotFoundError

2013-02-17 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___

[issue15767] add ModuleNotFoundError

2013-02-16 Thread Eric Snow
Eric Snow added the comment: +1 on just getting it done with ModuleNotFoundError. FWIW, I'd be glad to do it. I'm taking a self-imposed break from the nearly finished C-OrderedDict! -- ___ Python tracker rep...@bugs.python.org

[issue15767] add ModuleNotFoundError

2013-02-11 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___ Python-bugs-list mailing

[issue15767] add ModuleNotFoundError

2013-02-11 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: For me, it mostly comes down to whether end-users are expected to see such errors generally or not. We see ImportErrors all the time, and they are clearly errors. If we're expected to see and deal with MNF, and if in such cases it's generally considered an

[issue15767] add ModuleNotFoundError

2013-02-11 Thread Brett Cannon
Brett Cannon added the comment: Right, so what's typical? =) I mean do most people see ImportError for optional modules (e.g. not on support platforms), or do most people see ImportError because they messed up and tried to import something that they expected but actually isn't there for some

[issue15767] add ModuleNotFoundError

2013-02-11 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Feb 11, 2013, at 05:31 PM, Brett Cannon wrote: Right, so what's typical? =) I mean do most people see ImportError for optional modules (e.g. not on support platforms), or do most people see ImportError because they messed up and tried to import something

[issue15767] add ModuleNotFoundError

2013-02-11 Thread Brett Cannon
Brett Cannon added the comment: Screw it, I'll go with ModuleNotFoundError since it is a subclass of ImportError and so it might come off as weird as saying the superclass is an Error but the subclass is not. -- ___ Python tracker

[issue15767] add ModuleNotFoundError

2012-11-16 Thread Ezio Melotti
Ezio Melotti added the comment: I prefer ModuleNotFound. Its meaning is already clear enough, even without the Error suffix. OTOH we now have FileNotFoundError, but all the other OSError subclasses have that suffix. In general I think the suffix is necessary when it's not already clear from

[issue15767] add ModuleNotFoundError

2012-11-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: To state more explicitly the observation I alluded to in my comment above, we currently follow (without exception -- pun intended :) ) the convention that subclasses of exceptions that end in Error also end in Error. We also do the same with the suffix

[issue15767] add ModuleNotFoundError

2012-11-16 Thread Ezio Melotti
Ezio Melotti added the comment: That seems indeed to be the case with built-in exceptions. I'm not sure if it's intentional or just a coincidence. I agree that warnings should always have a Warning suffix to distinguish them from exceptions, but in the stdlib the Error suffix is not used

[issue15767] add ModuleNotFoundError

2012-11-15 Thread Brett Cannon
Brett Cannon added the comment: Should it be ModuleNotFoundError or ModuleNotFound? It's not necessarily an error if a module doesn't exist, so failing to find it isn't quite that negative. It also acts somewhat like StopIteration/GeneratorExit which also don't have the common Error suffix of

[issue15767] add ModuleNotFoundError

2012-11-15 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- stage: needs patch - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___

[issue15767] add ModuleNotFoundError

2012-11-15 Thread Chris Jerdonek
Chris Jerdonek added the comment: Since it subclasses ImportError, it seems like we're already considering it to be an error? StopIteration and GeneratorExit don't inherit from an Error exception type unlike, say, the OSError exception types. --

[issue15767] add ModuleNotFoundError

2012-11-15 Thread Chris Jerdonek
Chris Jerdonek added the comment: I meant to include this link for convenience: http://docs.python.org/dev/library/exceptions.html#exception-hierarchy -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767

[issue15767] add ModuleNotFoundError

2012-11-15 Thread Eric Snow
Eric Snow added the comment: I'd say ModuleNotFoundError. You could argue that other exception types aren't really errors in certain circumstances. I'd think that generally this would be an error. -- ___ Python tracker rep...@bugs.python.org

[issue15767] add ModuleNotFoundError

2012-11-15 Thread Eric Snow
Eric Snow added the comment: Effectively the exception indicates that the import system had an error. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___

[issue15767] add ModuleNotFoundError

2012-11-01 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___

[issue15767] add ModuleNotFoundError

2012-10-06 Thread Michele Orrù
Changes by Michele Orrù maker...@gmail.com: -- nosy: +maker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___ Python-bugs-list mailing

[issue15767] add ModuleNotFoundError

2012-08-27 Thread Chris Rebert
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___ Python-bugs-list

[issue15767] add ModuleNotFoundError

2012-08-25 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___

[issue15767] add ModuleNotFoundError

2012-08-22 Thread Eric Snow
New submission from Eric Snow: In issue 15316 (msg168896, Brett Cannon): Create a ModuleNotFoundError exception that subclasses ImportError and catch that (breaks doctests and introduces a new exception that people will need to be aware of, plus the question of whether it should just

[issue15767] add ModuleNotFoundError

2012-08-22 Thread Chris Jerdonek
Changes by Chris Jerdonek chris.jerdo...@gmail.com: -- nosy: +cjerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15767 ___ ___