Skip to content

Commit

Permalink
Added detection for case-sensitive file systems
Browse files Browse the repository at this point in the history
This is needed for the moment because of a bug in virtualenv (reported upstream).
  • Loading branch information
perlun committed Jun 14, 2016
1 parent 08a55e2 commit 22fddac
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions python/mach_bootstrap.py
Expand Up @@ -160,7 +160,22 @@ def _activate_virtualenv(topdir):
open(marker_path, 'w').close()


def _ensure_case_insensitive_if_windows():
# The folder is called 'python'. By deliberately checking for it with the wrong case, we determine if the file
# system is case sensitive or not.
if _is_windows() and not os.path.exists('Python'):
print('Cannot run mach in a path on a case-sensitive file system on Windows.')
print('For more details, see https://github.com/pypa/virtualenv/issues/935')
sys.exit(1)


def _is_windows():
return sys.platform == 'win32' or sys.platform == 'msys'


def bootstrap(topdir):
_ensure_case_insensitive_if_windows()

topdir = os.path.abspath(topdir)

# We don't support paths with Unicode characters for now
Expand Down

0 comments on commit 22fddac

Please sign in to comment.