def _get_win_folder_from_registry(csidl_name):<EOL>
import _winreg<EOL>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>directory, _type = _winreg.QueryValueEx(key, shell_folder_name)<EOL>return directory<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.