[issue888] hgexecutable can be inaccurate for frozen scripts

Paul Moore mercurial-bugs at selenic.com
Thu Dec 20 15:23:29 CST 2007


New submission from Paul Moore <p.f.moore at gmail.com>:

The hgexecutable() function in mercurial.util can give inaccurate answers when
the mercurial script has been frozen (using py2exe or tools/freeze). The
function determines the executable path from the $HG environment variable or by
searching for a 'hg' executable on $PATH.

In the case when a frozen script is being used, but it doesn't satisfy one of
these 2 conditions, the wrong value will be returned. In this case, it is
possible to get the correct value from sys.executable. I can't see any reason
not to do this - it's a rare case, certainly, but you get the right answer,
which isn't the case currently, and no other cases are affected.

I have attached a patch which fixes this issue.

----------
assignedto: pmezard
files: hgexecutable.patch
messages: 4662
nosy: p.f.moore, pmezard
priority: bug
status: unread
title: hgexecutable can be inaccurate for frozen scripts

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue888>
____________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hgexecutable.patch
Type: application/octet-stream
Size: 1641 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20071220/aeed649e/attachment.obj 


More information about the Mercurial-devel mailing list