This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients Trundle, belopolsky, brett.cannon, brian.curtin, cool-RR, eric.araujo, eric.snow, giampaolo.rodola, gruszczy, loewis, ncoghlan, nedbat, pitrou, r.david.murray, techtonik, vstinner
Date 2012-02-10.14:40:43
SpamBayes Score 4.983306e-09
Marked as misclassified No
Message-id <>
The patch looks fine for its current semantics except for the fact that the macro doesn't work under clang; ##macro_var is supposed to be used only when concatenating parts of a string to create a complete identifier, not concatenating two identifiers next to each other (e.g. gooblede##gook is fine, but self->##gook isn't because '->' is its own identifier).

But one issue is that for my purposes I need 'name' to be the full name of the module, not just the tail of the full name. The reason is that pydoc needs a way to tell when a module import failed because the module isn't there vs. when a module had an actual error itself. Using the tail end of the name doesn't help me because it means I can't tell if an import of a module named 'bunk' containing the line 'import test.bunk' fails because the module 'bunk' doesn't exist or because the import line failed since in both cases name == 'bunk'. But if name == 'test.bunk' there is no ambiguity. Pydoc used to do this by inspecting the stack and seeing where the exception was thrown which is just nasty and brittle (i.e. doesn't work with importlib since the stack goes much farther until ImportError is thrown).

IOW I don't think we should be tossing out valuable data just because historically modules that didn't exist only returned the tail end of the full module name. Anyone object to switching to using the full name of the module triggering the exception? The message wouldn't change to use the full name (unfortunately) for backwards-compatibility reasons of course.
Date User Action Args
2012-02-10 14:40:44brett.cannonsetrecipients: + brett.cannon, loewis, ncoghlan, belopolsky, pitrou, vstinner, techtonik, giampaolo.rodola, nedbat, eric.araujo, r.david.murray, Trundle, brian.curtin, gruszczy, cool-RR, eric.snow
2012-02-10 14:40:44brett.cannonsetmessageid: <>
2012-02-10 14:40:44brett.cannonlinkissue1559549 messages
2012-02-10 14:40:43brett.cannoncreate