def _get_win_folder_from_registry(csidl_name):
if PY3:<EOL><INDENT>import winreg as _winreg<EOL><DEDENT>else:<EOL><INDENT>import _winreg<EOL><DEDENT>shell_folder_name = {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>}[csidl_name]<EOL>key = _winreg.OpenKey(<EOL>_winreg.HKEY_CURRENT_USER,<EOL>r"<STR_LIT>"<EOL>)<EOL>dir, type = _winreg.QueryValueEx(key, shell_folder_name)<EOL>return dir<EOL>
This is a fallback technique at best. I'm not sure if using the
    registry for this guarantees us the correct answer for all CSIDL_*
    names.