Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#24 TTFont __init__ doesn't allow unicode filename

closed-fixed
Windows (1)
5
2004-09-25
2004-03-21
Mike C. Fletcher
No

At line 108 in fonttools\fonttools\ttlib\__init__.py ,
a check is done for:

if type(file) == types.StringType:

to determine whether a filename is to be opened or used
as a file. The check should probably be:

if isinstance( file, (str, unicode)):

in order to catch unicode filenames on Win32 as well as
to allow for string/unicode sub-classes such as "file
path" instances. At the very least it should be:

if type(file) in (types.StringType,types.UnicodeType):

Have fun,
Mike

Discussion

    • assigned_to: nobody --> jvr
     
  • Logged In: YES
    user_id=1112944

    Or simply just

    if isinstance(file, basestring):

    GT

     
  • Logged In: YES
    user_id=92689

    This problem has been fixed in CVS a long time ago... Btw here is
    a more or less convenient way to download a CVS snapshot:
    http://fonttools.sourceforge.net/cvs-snapshots/

     
    • status: open --> closed-fixed