What was up with posixfile

Christian Ebert blacktrash at gmx.net
Sat Apr 4 16:16:50 CDT 2009


* Matt Mackall on Friday, April 03, 2009 at 11:45:52 -0500
> So I debugged this last night.
> 
> When setup.py determines the version number before building extensions,
> it runs Mercurial in 'pure' mode by adding mercurial/pure to sys.path.
> 
> Some of the pure/ modules were doing things like:
> 
> import util
> 
> And this was subtly wrong. This in fact caused util to get fully
> imported a second time in a different scope. And the second time, its
> own call to
> 
> import posix
> 
> would load the built-in module rather than the one in mercurial/.
> 
> The fix for this is to change the pure modules to do:
> 
> from mercurial import util
> 
> which does the right thing without requiring renaming posix.py or any
> other silliness.
> 
> I've got fixes for this in my queue which I'll push out shortly.
> 
> Along the way, I fixed up a bunch of circular imports. The biggest of
> these was util->i18n->util for the encoding functions. So I decided it
> was time to move all the encoding stuff to its own module, encoding.

Thanks for the fix and the explanation.

c
-- 
\black\trash movie    _C O W B O Y_  _C A N O E_  _C O M A_
Ein deutscher Western/A German Western
-->> http://www.blacktrash.org/underdogma/ccc.html
-->> http://www.blacktrash.org/underdogma/ccc-en.html


More information about the Mercurial-devel mailing list