def get_home_dir():
    home_dir = _get_projconf_option_dir(
        "home_dir",
        join(expanduser("~"), ".platformio")
    )

    if "windows" in get_systype():
        try:
            home_dir.encode("utf8")
        except UnicodeDecodeError:
            home_dir = splitdrive(home_dir)[0] + "\\.platformio"

    if not isdir(home_dir):
        os.makedirs(home_dir)

    assert isdir(home_dir)
    return home_dir
dataset/ETHPy150Open platformio/platformio/platformio/util.py/get_home_dir/original