Quellcode durchsuchen

Handle UnicodeDecodeError on Python 3.8 on Windows.

Jelmer Vernooij vor 4 Jahren
Ursprung
Commit
905f56033a
1 geänderte Dateien mit 6 neuen und 7 gelöschten Zeilen
  1. 6 7
      dulwich/tests/test_index.py

+ 6 - 7
dulwich/tests/test_index.py

@@ -519,13 +519,6 @@ class BuildIndexTests(TestCase):
             repo.object_store.add_objects(
                 [(o, None) for o in [file, tree]])
 
-            try:
-                os.path.exists(latin1_path)
-            except UnicodeDecodeError:
-                # This happens e.g. with python3.6 on Windows.
-                # It implicitly decodes using utf8, which doesn't work.
-                self.skipTest('can not implicitly convert as utf8')
-
             try:
                 build_index_from_tree(
                     repo.path, repo.index_path(),
@@ -534,6 +527,12 @@ class BuildIndexTests(TestCase):
                 if e.errno == 92 and sys.platform == 'darwin':
                     # Our filename isn't supported by the platform :(
                     self.skipTest('can not write filename %r' % e.filename)
+                else:
+                    raise
+            except UnicodeDecodeError:
+                # This happens e.g. with python3.6 on Windows.
+                # It implicitly decodes using utf8, which doesn't work.
+                self.skipTest('can not implicitly convert as utf8')
 
             # Verify index entries
             index = repo.open_index()