filenames: only allow unicode in py2

i.e. restore the old behavior
This commit is contained in:
Adrien Tétar 2016-07-08 21:17:56 -07:00
parent d5514cc566
commit ec0fe57545

View File

@ -2,11 +2,8 @@
User name to file name conversion.
This was taken form the UFO 3 spec.
"""
from fontTools.misc.py23 import unicode
try:
basestring
except NameError:
basestring = str
illegalCharacters = "\" * + / : < > ? [ \ ] | \0".split(" ")
illegalCharacters += [chr(i) for i in range(1, 32)]
@ -71,7 +68,7 @@ def userNameToFileName(userName, existing=[], prefix="", suffix=""):
u'alt._con'
"""
# the incoming name must be a unicode string
assert isinstance(userName, basestring), "The value for userName must be a unicode string."
assert isinstance(userName, unicode), "The value for userName must be a unicode string."
# establish the prefix and suffix lengths
prefixLength = len(prefix)
suffixLength = len(suffix)