diff options
author | Yaroslav Halchenko <debian@onerussian.com> | 2015-02-07 11:14:42 -0500 |
---|---|---|
committer | Yaroslav Halchenko <debian@onerussian.com> | 2015-02-07 11:14:42 -0500 |
commit | 756b7ad43d0ad18858075f90ce5eaec2896d439c (patch) | |
tree | 4f5503d4ec44327712e1c794d322ba8bd9427d7c | |
parent | d7729245060f9aecfef4544f91e2656aa8d483ec (diff) | |
download | gitpython-756b7ad43d0ad18858075f90ce5eaec2896d439c.tar.gz |
BF: skip unicode filename test in env not supporting unicode encodings
-rw-r--r-- | git/test/test_base.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/git/test/test_base.py b/git/test/test_base.py index 91b9d005..72f2d554 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -5,6 +5,7 @@ # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php import os +import sys import tempfile import git.objects.base as base @@ -116,6 +117,14 @@ class TestBase(TestBase): filename = u"שלום.txt" file_path = os.path.join(rw_repo.working_dir, filename) + + # verify first that we could encode file name in this environment + try: + _ = file_path.encode(sys.getfilesystemencoding()) + except UnicodeEncodeError: + from nose import SkipTest + raise SkipTest("Environment doesn't support unicode filenames") + open(file_path, "wb").write(b'something') if os.name == 'nt': |