Skip to content

Commit e22a035

Browse files
committed
Added workaround for "dyld: Symbol not found: _utimensat" issue for macOS < 10.13 // Resolve platformio#70
1 parent 3cb0154 commit e22a035

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

get-platformio.py

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pioinstaller/python.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import platform
1919
import subprocess
2020
import sys
21+
import tempfile
2122

2223
import click
2324

@@ -113,6 +114,12 @@ def check():
113114
except ImportError:
114115
raise exception.DistutilsNotFound()
115116

117+
# portable Python 3 for macOS is not compatible with macOS < 10.13
118+
# https://github.com/platformio/platformio-core-installer/issues/70
119+
if util.IS_MACOS and sys.version_info >= (3, 5):
120+
with tempfile.NamedTemporaryFile() as tmpfile:
121+
os.utime(tmpfile.name)
122+
116123
if not util.IS_WINDOWS:
117124
return True
118125

pioinstaller/util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import requests
2626

2727
IS_WINDOWS = sys.platform.lower().startswith("win")
28+
IS_MACOS = sys.platform.lower() == "darwin"
2829

2930
log = logging.getLogger(__name__)
3031

0 commit comments

Comments
 (0)