Opened 12 years ago

Last modified 6 months ago

#37542 new defect

fonttools @2.3 ttx fails on FSpOpenResFile on 64bit python

Reported by: macports8@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: cooljeanius (Eric Gallager)
Port: fonttools

Description

On Mountain Lion, the ttx tool fails with AttributeError: 'module' object has no attribute 'FSpOpenResFile'

hannes-mbp:~ Hannes$ ttx Foo-Book.otf 
Dumping "Foo-Book.otf" to "Foo-Book.ttx"...
Traceback (most recent call last):
  File "/opt/local/bin/ttx", line 11, in <module>
    ttx.main(sys.argv[1:])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/FontTools/fontTools/ttx.py", line 297, in main
    process(jobs, options)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/FontTools/fontTools/ttx.py", line 282, in process
    action(input, output, options)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/FontTools/fontTools/ttx.py", line 172, in ttDump
    fontNumber=options.fontNumber)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/FontTools/fontTools/ttLib/__init__.py", line 145, in __init__
    if macUtils.getSFNTResIndices(file):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/FontTools/fontTools/ttLib/macUtils.py", line 28, in getSFNTResIndices
    resref = MyOpenResFile(path)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/FontTools/fontTools/ttLib/macUtils.py", line 18, in MyOpenResFile
    resref = Res.FSpOpenResFile(path, mode)
AttributeError: 'module' object has no attribute 'FSpOpenResFile'

This change fixes the problem:

https://github.com/mcolyer/fonttools/commit/e732bd3ba63c51df9aed903eb2147fa1af1bfdc2

Change History (4)

comment:1 Changed 12 years ago by jmroot (Joshua Root)

Looks like this change in the official upstream repo is more correct: http://fonttools.svn.sourceforge.net/viewvc/fonttools/trunk/Lib/fontTools/ttLib/macUtils.py?r1=403&r2=611

comment:2 in reply to:  1 Changed 12 years ago by macports8@…

Replying to jmr@…:

Looks like this change in the official upstream repo is more correct: http://fonttools.svn.sourceforge.net/viewvc/fonttools/trunk/Lib/fontTools/ttLib/macUtils.py?r1=403&r2=611

I can confirm that this also fixes the problem for me. As to whether it is more correct or not, I will have to defer to your judgement. I don't know this part of the Python runtime library well enough.

comment:3 Changed 10 years ago by dbevans (David B. Evans)

fonttools updated to version 2.4 (released 2013-06-22) r127749 using python27. Does this fix the reported issue?

comment:4 Changed 6 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.