Issue 14967: distutils2.utils.resolve_name cannot be implemented to give correct errors in all situations (original) (raw)

Created on 2012-05-31 11:34 by Ronny.Pfannschmidt, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg161990 - (view) Author: Ronny Pfannschmidt (Ronny.Pfannschmidt) Date: 2012-05-31 11:34
due to the lack of a marker that denotes where the module ends and the attribute starts, unrelated import errors can break the try&error chain at unexpected places and the code can pass on to the recursive getattr chain, giving a completely different error instead of the real error this is not solvable without a marker or really nasty hacks o track subsequent imports
msg161991 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2012-05-31 12:01
the current code works as expected. Why not leaving it like this since your change seem to be comsetics only ?
msg161992 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2012-05-31 12:01
can you give an example of a bad error ?
msg161993 - (view) Author: Ronny Pfannschmidt (Ronny.Pfannschmidt) Date: 2012-05-31 12:26
to correctly implement it we need the : separator back with the separator the import specification is no longer ambigious, and we can use one exact import, and an error will always be an error
msg161994 - (view) Author: Ronny Pfannschmidt (Ronny.Pfannschmidt) Date: 2012-05-31 12:29
an example of creating a wrong error would be something like the following: there is a package foo.bar, which does a wrong import in __init__.py we want to resolve the name foo.bar.something we'd get the error that foo has no attribute bar
msg164568 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-07-03 04:39
Please keep the discussion in one place, the other bug report.
History
Date User Action Args
2022-04-11 14:57:31 admin set github: 59172
2012-07-03 04:39:03 eric.araujo set status: open -> closedmessages: + stage: resolved
2012-05-31 12:29:03 Ronny.Pfannschmidt set messages: +
2012-05-31 12:26:52 Ronny.Pfannschmidt set messages: +
2012-05-31 12:03:42 tarek set resolution: duplicatesuperseder: Improve error reporting for packaging.util.resolve_name
2012-05-31 12:01:57 tarek set messages: +
2012-05-31 12:01:25 tarek set messages: +
2012-05-31 11:34:36 Ronny.Pfannschmidt create