Bug 2074 - hg.bat doesn't work when Python installed in Program Files
Summary: hg.bat doesn't work when Python installed in Program Files
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-06 12:24 UTC by Eugene Baranov
Modified: 2012-05-13 05:00 UTC (History)
5 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Baranov 2010-03-06 12:24 UTC
I've downloaded the latest Mercurial source and build and installed it on my 
Windows machine.

Python's Script folder is in my Path variable, but Mercurial's install 
generated hg.bat file calling hg:

%~dp0..\python "%~dp0hg" %*

This causes an error when Python is installed in a path containing spaces 
(e.g. "C:\Program Files\Python") -- it will try to call "C:\Program" with 
arguments "Files\Python\python ...")

I've fixed it in my install by quoting python:
"%~dp0..\python" "%~dp0hg" %*
Comment 1 HG Bot 2010-10-09 11:00 UTC
Fixed by http://hg.intevation.org/mercurial/crew/rev/5096faaa280e
Benjamin Pollack <benjamin@bitquabit.com>
windows: handle spaces in path to Python (issue2074)
Comment 2 Martin Geisler 2010-10-10 20:10 UTC
Isssue2421 is a duplicate of this one.
Comment 3 Bugzilla 2012-05-12 09:07 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:07 EDT  ---

This bug was previously known as _bug_ 2074 at http://mercurial.selenic.com/bts/issue2074