From 68e3f9dc00056acb6c7b3a8caa34568b07ce9a12 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 9 Jan 2019 16:34:39 +0200 Subject: [PATCH 01/12] Fix "Runtime Error: Dictionary size changed during iteration" // Resolve #2003 --- HISTORY.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 651451d4..37b2acd1 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -14,6 +14,8 @@ PlatformIO 3.0 - CLion: Improved project portability using "${CMAKE_CURRENT_LIST_DIR}" instead of full path * Fixed an issue with incorrect detecting of compatibility (LDF) between generic library and Arduino or ARM mbed frameworks +* Fixed "Runtime Error: Dictionary size changed during iteration" + (`issue #2003 `_) 3.6.3 (2018-12-12) ~~~~~~~~~~~~~~~~~~ From d5d95092c4cedb6dc3d0f907638c83b01845f872 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Jan 2019 19:14:03 +0200 Subject: [PATCH 02/12] Fix an error "Could not extract item..." when extracting TAR archive with symbolic items on Windows platform // Resolve #2015 --- HISTORY.rst | 2 ++ platformio/unpacker.py | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 37b2acd1..24134227 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -16,6 +16,8 @@ PlatformIO 3.0 * Fixed an issue with incorrect detecting of compatibility (LDF) between generic library and Arduino or ARM mbed frameworks * Fixed "Runtime Error: Dictionary size changed during iteration" (`issue #2003 `_) +* Fixed an error "Could not extract item..." when extracting TAR archive with symbolic items on Windows platform + (`issue #2015 `_) 3.6.3 (2018-12-12) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/unpacker.py b/platformio/unpacker.py index 8f55b42d..11c23814 100644 --- a/platformio/unpacker.py +++ b/platformio/unpacker.py @@ -13,7 +13,7 @@ # limitations under the License. from os import chmod -from os.path import exists, islink, join +from os.path import exists, join from tarfile import open as tarfile_open from time import mktime from zipfile import ZipFile @@ -56,6 +56,10 @@ class TARArchive(ArchiveBase): def get_item_filename(self, item): return item.name + @staticmethod + def islink(item): + return item.islnk() or item.issym() + class ZIPArchive(ArchiveBase): @@ -80,6 +84,9 @@ class ZIPArchive(ArchiveBase): def get_item_filename(self, item): return item.filename + def islink(self, item): + raise NotImplementedError() + def after_extract(self, item, dest_dir): self.preserve_permissions(item, dest_dir) self.preserve_mtime(item, dest_dir) @@ -120,7 +127,9 @@ class FileUnpacker(object): for item in self._unpacker.get_items(): filename = self._unpacker.get_item_filename(item) item_path = join(dest_dir, filename) - if not islink(item_path) and not exists(item_path): - raise exception.ExtractArchiveItemError(filename, dest_dir) - + try: + if not self._unpacker.islink(item) and not exists(item_path): + raise exception.ExtractArchiveItemError(filename, dest_dir) + except NotImplementedError: + pass return True From 19b5285d508ed64e31fd5d4b867a8183bde53920 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Jan 2019 19:33:15 +0200 Subject: [PATCH 03/12] Fix "TypeError : startswith first arg" when checking udev rules with PY3 // Resolve #2000 --- platformio/util.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/platformio/util.py b/platformio/util.py index c5433ee3..d350c222 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -797,14 +797,10 @@ def merge_dicts(d1, d2, path=None): def ensure_udev_rules(): def _rules_to_set(rules_path): - result = set([]) - with open(rules_path, "rb") as fp: - for line in fp.readlines(): - line = line.strip() - if not line or line.startswith("#"): - continue - result.add(line) - return result + return set([ + l.strip() for l in get_file_contents(rules_path).split("\n") + if l.strip() and not l.startswith("#") + ]) if "linux" not in get_systype(): return None From 56cd55ba7d486b5befeb807e8d21c4e4555c2a0b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Jan 2019 21:57:39 +0200 Subject: [PATCH 04/12] Eclipse: Provide language standard to a project C/C++ indexer // Resolve #1010 --- HISTORY.rst | 2 ++ .../eclipse/.settings/language.settings.xml.tpl | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 24134227..2596a50c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -12,6 +12,8 @@ PlatformIO 3.0 - Use full path to PlatformIO CLI when generating a project (`issue #1674 `_) - CLion: Improved project portability using "${CMAKE_CURRENT_LIST_DIR}" instead of full path + - Eclipse: Provide language standard to a project C/C++ indexer + (`issue #1010 `_) * Fixed an issue with incorrect detecting of compatibility (LDF) between generic library and Arduino or ARM mbed frameworks * Fixed "Runtime Error: Dictionary size changed during iteration" diff --git a/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl b/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl index 19740737..72895fb2 100644 --- a/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl +++ b/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl @@ -1,3 +1,8 @@ +% import re +% STD_RE = re.compile(r"(\-std=[a-z\+]+\d+)") +% cxx_stds = STD_RE.findall(cxx_flags) +% cxx_std = cxx_stds[-1] if cxx_stds else "" +% @@ -6,9 +11,9 @@ % if "windows" in systype: - + % else: - + % end @@ -21,9 +26,9 @@ % if "windows" in systype: - + % else: - + % end From 13430aa628ab80b9d424d3d7948a7f69ebecff0c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 11 Jan 2019 12:52:00 +0200 Subject: [PATCH 05/12] Use GCC C++ compiler for Eclipse project indexer // Issue #1010 --- .../ide/tpls/eclipse/.settings/language.settings.xml.tpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl b/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl index 72895fb2..a119c8b2 100644 --- a/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl +++ b/platformio/ide/tpls/eclipse/.settings/language.settings.xml.tpl @@ -11,9 +11,9 @@ % if "windows" in systype: - + % else: - + % end @@ -26,9 +26,9 @@ % if "windows" in systype: - + % else: - + % end From f058b8f18f79bdd184f7aa22948e24a388e3711a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 11 Jan 2019 13:01:53 +0200 Subject: [PATCH 06/12] Fix PY3 Lint "consider-using-set-comprehension" --- platformio/util.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platformio/util.py b/platformio/util.py index d350c222..11364072 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -797,10 +797,8 @@ def merge_dicts(d1, d2, path=None): def ensure_udev_rules(): def _rules_to_set(rules_path): - return set([ - l.strip() for l in get_file_contents(rules_path).split("\n") - if l.strip() and not l.startswith("#") - ]) + return set(l.strip() for l in get_file_contents(rules_path).split("\n") + if l.strip() and not l.startswith("#")) if "linux" not in get_systype(): return None From d627a42268ee225d91f6a256220c002ec7418e75 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 11 Jan 2019 14:07:35 +0200 Subject: [PATCH 07/12] Fix PyLint warning --- platformio/util.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platformio/util.py b/platformio/util.py index 11364072..5fe186d7 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -794,6 +794,15 @@ def merge_dicts(d1, d2, path=None): return d1 +def get_file_contents(path): + try: + with open(path) as f: + return f.read() + except UnicodeDecodeError: + with open(path, encoding="latin-1") as f: + return f.read() + + def ensure_udev_rules(): def _rules_to_set(rules_path): From b594c1171851e68b2580f8fb15f51409b31dba17 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Jan 2019 17:56:21 +0200 Subject: [PATCH 08/12] Fix cmd_lib test --- tests/commands/test_lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/commands/test_lib.py b/tests/commands/test_lib.py index 7fc6ca90..b67cec39 100644 --- a/tests/commands/test_lib.py +++ b/tests/commands/test_lib.py @@ -170,7 +170,7 @@ def test_global_lib_list(clirunner, validate_cliresult): ] versions2 = [ 'ArduinoJson@5.8.2', 'ArduinoJson@5.10.1', 'AsyncMqttClient@0.8.2', - 'AsyncTCP@1.0.1', 'NeoPixelBus@2.2.4', 'PJON@07fe9aa', 'PJON@1fb26fd', + 'NeoPixelBus@2.2.4', 'PJON@07fe9aa', 'PJON@1fb26fd', 'PubSubClient@bef5814', 'RFcontrol@77d4eb3f8a', 'RadioHead-1.62@0.0.0' ] assert set(versions1) >= set(versions2) From db0bbcc0434323b2e5da6326400c555e0987bb53 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Jan 2019 18:04:52 +0200 Subject: [PATCH 09/12] CLion: Improve project portability using "${CMAKE_CURRENT_LIST_DIR}" instead of USER_HOME --- platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl index 65423e22..a1c84d68 100644 --- a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl +++ b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl @@ -1,12 +1,12 @@ % def _normalize_path(path): -% if user_home_dir in path: +% if project_dir in path: +% path = path.replace(project_dir, "${CMAKE_CURRENT_LIST_DIR}") +% elif user_home_dir in path: % if "windows" in systype: % path = path.replace(user_home_dir, "$ENV{HOMEDRIVE}$ENV{HOMEPATH}") % else: % path = path.replace(user_home_dir, "$ENV{HOME}") % end -% elif project_dir in path: -% path = path.replace(project_dir, "${CMAKE_CURRENT_LIST_DIR}") % end % return path.replace("\\", "/") % end From 69065d8bd6098f569a2693f66ced61fd9e96a411 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 22 Jan 2019 21:59:26 +0200 Subject: [PATCH 10/12] Fix "ValueError: invalid literal for int() with base 10" // Resolve #2058 --- platformio/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/app.py b/platformio/app.py index 14c4de22..d3c82d25 100644 --- a/platformio/app.py +++ b/platformio/app.py @@ -226,9 +226,9 @@ class ContentCache(object): newlines = [] with open(self._db_path) as fp: for line in fp.readlines(): + line = line.strip() if "=" not in line: continue - line = line.strip() expire, path = line.split("=") if time() < int(expire) and isfile(path) and \ path not in paths_for_delete: From 28bca48eca07951deda8121b4ba836537842c006 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 12 Jan 2019 01:08:13 +0200 Subject: [PATCH 11/12] Ignore examples for ststm8 on Linux --- tests/test_examples.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_examples.py b/tests/test_examples.py index d9588956..0727da75 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -37,7 +37,8 @@ def pytest_generate_tests(metafunc): if not p.is_embedded(): continue # issue with "version `CXXABI_1.3.9' not found (required by sdcc)" - if "linux" in util.get_systype() and p.name == "intel_mcs51": + if "linux" in util.get_systype() and p.name in ("intel_mcs51", + "ststm8"): continue examples_dir = join(p.get_dir(), "examples") assert isdir(examples_dir) From 367e4d663c4a0ea199b5743cdd52fda6db9daf41 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 23 Jan 2019 20:47:18 +0200 Subject: [PATCH 12/12] Bump version to 3.6.4 --- HISTORY.rst | 2 +- platformio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 2596a50c..fb8f8747 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release Notes PlatformIO 3.0 -------------- -3.6.4 (2018-??-??) +3.6.4 (2019-01-23) ~~~~~~~~~~~~~~~~~~ * Improved Project Generator for IDEs: diff --git a/platformio/__init__.py b/platformio/__init__.py index 07fa8a5d..bb0d7626 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 6, "4b1") +VERSION = (3, 6, 4) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio"