[pygr-notify] Issue 47 in pygr: KeyError on deleting pygr.Data resource

codesite-noreply at google.com codesite-noreply at google.com
Fri Oct 17 16:23:18 PDT 2008


Issue 47: KeyError on deleting pygr.Data resource
http://code.google.com/p/pygr/issues/detail?id=47

New issue report by robert.d.kirkpatrick:
What steps will reproduce the problem?
1. Save a resource to pygr.Data with no SCHEMA
2. Delete the resource (i.e. via pygr.Data.deleteResource )


What is the expected output? What do you see instead?
Expected output is nothing.  We see a KeyError instead:

Traceback (most recent call last):
   File "/Users/Robby/pygr-dev/bin/python", line 23, in <module>
     execfile(sys.argv[0])
   File "/Users/Robby/Desktop/delete-resource-schema-error.py", line 32, in
<module>
     remRes()
   File "/Users/Robby/Desktop/delete-resource-schema-error.py", line 26, in
remRes
     pygr.Data.deleteResource(sqltab)
   File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pygr-0.7-py2.5-macosx-10.3-fat.egg/pygr/Data.py",
line 864, in deleteResource
     self.delSchema(id,layer)
   File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pygr-0.7-py2.5-macosx-10.3-fat.egg/pygr/Data.py",
line 1019, in delSchema
     d=db.getschema(id) # GET THE EXISTING SCHEMA
   File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pygr-0.7-py2.5-macosx-10.3-fat.egg/pygr/Data.py",
line 536, in getschema
     return self.db['SCHEMA.'+id]
   File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shelve.py",  
line
112, in __getitem__
     f = StringIO(self.dict[key])
   File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/bsddb/__init__.py",
line 223, in __getitem__
     return _DeadlockWrap(lambda: self.db[key])  # self.db[key]
   File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/bsddb/dbutils.py",
line 62, in DeadlockWrap
     return function(*_args, **_kwargs)
   File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/bsddb/__init__.py",
line 223, in <lambda>
     return _DeadlockWrap(lambda: self.db[key])  # self.db[key]
KeyError: 'SCHEMA.Bio.Seq.Genome.ECOLI'


What version of the product are you using? On what operating system?
Using MacOS v10.4 or v10.5
git commit # c42925322ab8258b40bd09fd9bf0c871c6ebf75a


Please provide any additional information below.
The pygr.Data resource does in fact get deleted but a call is made to
delSchema() with a pygr.Data resource id of 'SCHEMA.name.of.resource'.  If
no schema was ever saved, this resource will never exist and thus retrieval
via "d=db.getschema(id) # GET THE EXISTING SCHEMA" will always produce the
KeyError.

See attached script and modified ecoli 'genome' file to reproduce.



Attachments:
	ECOLI.fna  2.9 KB
	delete-resource-schema-error.py  645 bytes


Issue attributes:
	Status: New
	Owner: ----
	Labels: Type-Defect Priority-Medium

-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings



More information about the pygr-notify mailing list