Skip to content

Commit a076378

Browse files
authored
Merge pull request #84 from MartinFalatic/mff-fix-unicode-tests
fixes #81
2 parents 853a1fd + f64eb50 commit a076378

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/test_entry.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77
import locale
88
from os import environ, stat
99
from os.path import join
10+
import unicodedata
1011

1112
from libarchive import memory_reader, memory_writer
1213

1314
from . import data_dir, get_entries, get_tarinfos
1415

1516

17+
text_type = unicode if str is bytes else str # noqa: F821
18+
1619
locale.setlocale(locale.LC_ALL, '')
1720

1821
# needed for sane time stamp comparison
@@ -93,4 +96,9 @@ def check_entries(test_file, regen=False, ignore=''):
9396
for key in ignore:
9497
e1.pop(key)
9598
e2.pop(key)
99+
# Normalize all unicode (can vary depending on the system)
100+
for d in (e1, e2):
101+
for key in d:
102+
if isinstance(d[key], text_type):
103+
d[key] = unicodedata.normalize('NFC', d[key])
96104
assert e1 == e2

0 commit comments

Comments
 (0)