KeyError: '13'
Phanindra Ramesh Challa
cpr.17a at gmail.com
Wed Jun 6 02:36:58 EDT 2012
I am trying to run a python program. It is giving the KeyError: '13'. I
have no clue regarding this error.
this is the python code relevant to the error:
dpi = 100
bold = 0
italic = 0
mono = 0
comment = ""
dbname = "font.db"
for o, a in opts:
if o == '-b': bold = 1
if o == '-i': italic = 1
if o == '-m': mono = 1
if o == '-d': dpi = int (a)
if o == '-c': comment = string.join (string.split (a), " ")
if o == '-g': dbname = a
fontname = args[0]
pixel_size = int (args[1])
point_size = int (pixel_size * 72.27 / dpi + 0.5)
# Approximate average glyph width.
avg_width = pixel_size * 17 / 24
db = anydbm.open (dbname, "r")
codes = loads (db [str (pixel_size)])
And the error is :
python2 ../../../mk_bdf.py -c "Converted from fonts of Computer Modern
family (C) 1979-1985 Donald E. Knuth and others." -b 'TeX Sans' 13 >
tex09sb.bdf
Traceback (most recent call last):
File "../../../mk_bdf.py", line 108, in <module>
codes = loads (db [str (pixel_size)])
File "/usr/lib/python2.7/bsddb/__init__.py", line 270, in __getitem__
return _DeadlockWrap(lambda: self.db[key]) # self.db[key]
File "/usr/lib/python2.7/bsddb/dbutils.py", line 68, in DeadlockWrap
return function(*_args, **_kwargs)
File "/usr/lib/python2.7/bsddb/__init__.py", line 270, in <lambda>
return _DeadlockWrap(lambda: self.db[key]) # self.db[key]
KeyError: '13'
Anybody please help me in running the program.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120606/d5be67c7/attachment.html>
More information about the Python-list
mailing list