Windows: using hg executable from an IDE results in python errors

Howard Ha bluespire at
Thu Mar 20 13:20:40 CDT 2008

Hi everyone,

I'm completely new to Mercurial, but a longtime cvsnt user considering 
moving our entire team to Hg.

We do web development on Windows boxes using PHPEd as our IDE, and 
luckily that tool has the ability to integrate with external apps by 
executing "shell scripts" (they use this to integrate svn and cvs with 
the IDE).  The added benefit of using this over just using tortoiseHg is 
that we can assign keyboard shortcuts (highly useful) to the actions 
that we integrate (push, pull, update, commit, log, etc).

I managed to figure out how to create an appropriate shell script 
command line for using Mercurial with PHPEd, but the result is a crash 
and error dump.  The EXACT SAME command in a windows command prompt 
works perfectly fine.

The error output is:

c:\development\tortoisehg\hg.exe log --cwd 
Traceback (most recent call last):   
File "hg", line 29, in <module> 
File "mercurial\util.pyc", line 992, in set_binary
IOError: [Errno 9] Bad file descriptor

I'm using the tortoisehg's hg.exe executable, but the same errors 
(different line numbers) come up if I use the executables made by Lee 
Cantey (

Opening up cmd.exe and running:

c:\development\tortoisehg\hg.exe log --cwd 

Works perfectly.

Any ideas what the problem might be and any possible work arounds?  I'm 
unsure how PHPEd is executing the script, but I assume there must be 
some environment variables missing or something.

Any help would be GREATLY appreciated.


More information about the Mercurial mailing list