__init__.py:560:getGlyphID:UnboundLocalError: local variable 'glyphID' referenced before assignment #86

Open
behdad opened this Issue Jan 16, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@behdad
Owner

behdad commented Jan 16, 2014

https://sourceforge.net/p/fonttools/bugs/46/

FWIW, I can see how that error can happen in this block:

                                # user intends virtual GID support      
                                try:
                                        glyphID = self.reverseVIDDict[glyphName]
                                except KeyError:
                                        # if name is in glyphXXX format, use the specified name.
                                        if glyphName[:5] == "glyph":
                                                try:
                                                        glyphID = int(glyphName[5:])
                                                except (NameError, ValueError):
                                                        glyphID = None
                                        if glyphID is None:
                                                glyphID = self.last_vid -1
                                                self.last_vid = glyphID
                                        self.reverseVIDDict[glyphName] = glyphID
                                        self.VIDDict[glyphID] = glyphName
                                return glyphID
@pivanov

This comment has been minimized.

Show comment Hide comment
@pivanov

pivanov Aug 25, 2014

I receive same error

pivanov commented Aug 25, 2014

I receive same error

@behdad

This comment has been minimized.

Show comment Hide comment
@behdad

behdad Aug 25, 2014

Owner

Thanks. I will fix this soon.

Owner

behdad commented Aug 25, 2014

Thanks. I will fix this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment