The function in question assumes that ROOT is a prefix of full_path, and tries to remove it. However, it is not necessarily a prefix:
when ROOT is determined, both os.path.abspath() and os.path.realpath() gets called
when full_path is determined, only os.path.abspath() is called
This means that if the path contains a symlink, it will show up as resolved in ROOT, but not full_path, so simply removing the first X characters of full_path is not sufficient.
This PR adds an assertion to catch the bad situation early, then adds the os.path.realpath call to full_path.
[x] ran the linter to address style issues (tox -e fix)
Original issue: https://github.com/pypa/virtualenv/issues/1949
Added test for pull https://github.com/pypa/virtualenv/pull/2613