setup.py --version is broken

Martin Geisler mg at lazybytes.net
Sat Dec 5 15:47:33 CST 2009


Steve Borho <steve at borho.org> writes:

>> This hack makes it work for me again:
>>
>> C:\thg-winbuild\build-hg>hg diff
>> diff -r 2770d03ae49f setup.py
>> --- a/setup.py  Thu Dec 03 11:06:55 2009 +0100
>> +++ b/setup.py  Sat Dec 05 12:22:51 2009 -0600
>> @@ -118,7 +118,7 @@
>>     # includes the pure Python modules in mercurial/pure. We also take
>>     # care to not use any hgrc files and do no localization.
>>     pypath = ['mercurial', os.path.join('mercurial', 'pure')]
>> -    env = {'PYTHONPATH': os.pathsep.join(pypath),
>> +    env = {#'PYTHONPATH': os.pathsep.join(pypath),
>>            'HGRCPATH': '',
>>            'LANGUAGE': 'C'}
>>     if 'LD_LIBRARY_PATH' in os.environ:
>>
>> The way it overrides PYTHONPATH like that, it can only ever work if
>> you have done the equivalent of 'make local' in your repository.
>>  This is not something that is commonly done on Windows.
>
> Sorry, the workaround was correct but my analysis was bogus. What
> actually happens is the runcmd() function is returning an empty string
> because python is outputting a warning to stderr:
>
> err warning: Not importing directory 'C:\thg-winbuild\build-hg\mercurial\locale'
> : missing __init__.py

Oh, ups!

I searched a bit, and as I understand it, we trigger this warning when
encoding.py does 'import locale'. This is Python's way of telling us
that it picks locale.py from the standard library (good!) instead of the
"missing" locale/__init__.py.

That was... unexpected.

I wonder why I'm not seeing this warning all the time? I don't even see
it if I add the mercurial folder to my PYTHONPATH.

Do you think we need to do more than ignore the warning in setup.py?

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20091205/0adab727/attachment.pgp>


More information about the Mercurial-devel mailing list