def path_to_cache_dir(path):
d, p = os.path.splitdrive(os.path.abspath(path))<EOL>if d:<EOL><INDENT>d = d.replace('<STR_LIT::>', '<STR_LIT>')<EOL><DEDENT>p = p.replace(os.sep, '<STR_LIT>')<EOL>return d + p + '<STR_LIT>'<EOL>
Convert an absolute path to a directory name for use in a cache.

The algorithm used is:

#. On Windows, any ``':'`` in the drive is replaced with ``'---'``.
#. Any occurrence of ``os.sep`` is replaced with ``'--'``.
#. ``'.cache'`` is appended.