Use root directory for PIO Home when path contains non-ascii characters // Resolve #951 Resolve #952

This commit is contained in:
Ivan Kravets
2017-05-04 21:02:32 +03:00
parent f3f8374253
commit d37c6fcdce
2 changed files with 14 additions and 7 deletions

View File

@ -28,6 +28,9 @@ PlatformIO 3.0
* Handle ``env_default`` in `Project Configuration File "platformio.ini" <http://docs.platformio.org/page/projectconf.html>`__
when re-initializing a project
(`issue #950 <https://github.com/platformio/platformio-core/issues/950>`_)
* Use root directory for PIO Home when path contains non-ascii characters
(`issue #951 <https://github.com/platformio/platformio-core/issues/951>`_,
`issue #952 <https://github.com/platformio/platformio-core/issues/952>`_)
* Don't warn about known ``boards_dir`` option
(`pull #949 <https://github.com/platformio/platformio-core/pull/949>`_)
* Fixed infinite dependency installing when repository consists of multiple
@ -44,7 +47,7 @@ PlatformIO 3.0
* Development platform `Atmel AVR <https://github.com/platformio/platform-atmelavr>`__
+ ATTiny Support (1634, x313, x4, x41, x5, x61, x7, x8)
(`issue #47 <https://github.com/platformio/platform-atmelavr/issues/47>`_)
(`issue #47 <https://github.com/platformio/platform-atmelavr/issues/47>`__)
+ New boards: Dwenguino, nicai-systems BOB3 coding bot, NIBO 2 robot,
NIBObee robot
+ AVRDude TCP upload port (``net:host:port``)

View File

@ -220,15 +220,19 @@ def get_project_optional_dir(name, default=None):
def get_home_dir():
home_dir = get_project_optional_dir("home_dir",
join(expanduser("~"), ".platformio"))
win_home_dir = None
if "windows" in get_systype():
try:
home_dir.encode("utf8")
except UnicodeDecodeError:
home_dir = splitdrive(home_dir)[0] + "\\.platformio"
win_home_dir = splitdrive(home_dir)[0] + "\\.platformio"
if isdir(win_home_dir):
home_dir = win_home_dir
if not isdir(home_dir):
os.makedirs(home_dir)
try:
os.makedirs(home_dir)
except WindowsError:
if win_home_dir:
os.makedirs(win_home_dir)
home_dir = win_home_dir
assert isdir(home_dir)
return home_dir