On Tue, 7 Jan 2014 07:27:11 +0000, Steve Barnes wrote:
> On 06/01/14 16:05, Yuya Nishihara wrote:
> > CC-ing to tortoisehg-discuss because tortoisehg-issues is for issue
> > notification.
> >
> > On Mon, 6 Jan 2014 06:26:48 +0000, Steve Barnes wrote:
> >> On Sun, 2014-01-05 at 20:24 +0000, Steve Barnes wrote:
> >>> Depending on the content of PYHTONPATH and lib/site-packages when thg
> >>> loads it attempts to import from tortoise.util.config - if this fails
> >>> then demandimport will import any config module that it finds - in my
> >>> case it is now importing config from wxPython 3.0.0 or from pyspread.
> >>> This seems to be because it effectively does from *[.*[.*]] import config.
> > - So, it doesn't happen with demandimport.disable() ?
> > - Which Mercurial version?
> > - PYTHONPATH is ..?
> >
> >
> Yuya,
> 
> I didn't try demandimport.disable(), Mercurial version 2.8.1, I tried 
> numerous PYTHONPATH values and it just changed which other package the 
> wrong config.py was found in.  Eventually I figured out that the 
> tortoisehg hg repository doesn't contain config.py and does contain 
> .hg/requies so that setup.py wasn't creating a config.py - once I 
> 'manually' created it the problem disappeared.
> 
> I do feel that, if from package import * is discouraged because of the 
> lack of clarity due to name space removal and because of the hard to 
> diagnose problems that occur when you have name clashes, then code that 
> effectively does if not found path.to.package from 
> anwhere.recurse.package import ... is potentially even more perilous.  
> In my specific case if the exception output had been "can't load 
> tortoisehg.util.config" I would probably have resolved the issue in a 
> few minutes as it was I was getting "missing method mmmm in 
> random.package.config" - this took days to isolate.

I'm curious why random.package.config was imported because "from config
import ..." shouldn't look for such deep modules.  So I've asked whether
it is caused by demandimport or not.

FWIW, it will be good thing to make "try import" line more robust.

Can you file a bug report to BTS?
https://bitbucket.org/tortoisehg/thg/issues

Regards,

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Tortoisehg-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss

Reply via email to