From 5d8535cb9cd1c8b79cd4a1a3debad092e072a550 Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Mon, 28 Jan 2019 14:07:45 +0100 Subject: [PATCH] Test string must be Unicode --- src/octoprint/settings.py | 2 +- tests/util/test_file_helpers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index b28a766e0..caad49d72 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -1833,7 +1833,7 @@ def _validate_folder(folder, create=True, check_writable=True, deep_check_writab testfile = os.path.join(folder, ".testballoon.txt") try: with io.open(testfile, 'wt', encoding='utf-8') as f: - f.write("test") + f.write(u"test") os.remove(testfile) except Exception: if log_error: diff --git a/tests/util/test_file_helpers.py b/tests/util/test_file_helpers.py index 0f957d94a..6cbb29b12 100644 --- a/tests/util/test_file_helpers.py +++ b/tests/util/test_file_helpers.py @@ -334,7 +334,7 @@ class IsHiddenPathTest(unittest.TestCase): self.path_always_hidden = os.path.join(self.basepath, ".always_hidden.txt") import sys - for attr in ("path_always_visible", "path_hidden_on_windows", "path_always_hidden"): + for attr in (u"path_always_visible", u"path_hidden_on_windows", u"path_always_hidden"): path = getattr(self, attr) with io.open(path, 'wt+', encoding='utf-8') as f: f.write(attr)