On Thu, Mar 14, 2013 at 12:02 AM, Ulf Larsson <[email protected]>wrote:

>
> Hi all,
>
> When doing update (or clone) with svn or git subrepos on windows,
> tortoisehg aborts with an 'the handle is invalid' error.
>
> This has been reported as https://bitbucket.org/tortoisehg/thg/issue/484
>
> I think the problem is that subprocess.Popen is used in the mercurial code
> to call the command line tools for svn and git. But subprocess.Popen
> does not work well with pythonw as reported in
> http://bugs.python.org/issue3905.
>
> When using pythonw sys.stdin is not valid but still != None. Adding the
> following line to the thg main script:
>
> if sys.stdin and sys.stdin.fileno() < 0:
>     sys.stdin = None
>
> makes tortoisehg update of svn subrepos work on windows. Is this an
> acceptable fix for tortoisehg?
>
>
> I believe that pythonw in python3 has sys.stdin == None.
>

Thanks for digging into this. I looked for a more reliable check and found:

http://www.velocityreviews.com/forums/t729325-re-windows-how-to-detect-whether-a-python-app-script-is-runningin-console-gui-mode.html

And have now pushed this:

https://bitbucket.org/tortoisehg/thg/commits/dd1848441aa82a192cf8bc23adbbad9c4dd81b60

Can you verify this works as you expect?

-- 
Steve Borho
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Tortoisehg-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss

Reply via email to