PS. It gets worse: if I read the file into a string and call

pybel.readstring( "sdf", string, opt = { "canonical" : None } )

it works. So here's the scenario:

I'm running under mod_wsgi.

The app uses urllib.urlretrieve() to fetch an sdf file from pubchem and
saves it on disk. Immediately after that it calls

pybel.readfile( "sdf", sdf, opt = { "canonical" : None } ).next()

and that works and returns a pybel molecule. When I get to the same

pybel.readfile( "sdf", sdf, opt = { "canonical" : None } ).next()

later, from a different web form, that fails with

File "/opt/lib/pybel.py", line 145, in filereader
 notatend = obconversion.ReadFile(obmol,filename)
TypeError: in method 'OBConversion_ReadFile', argument 3 of type
'std::string'

On the off-chance that pybel/obabel/.so keeps the state between wsgi
invocations I tried changing the readfile call to

list( pybel.readfile( "sdf", sdf, opt = { "canonical" : None } ) )

and returning list[0] -- no dice, still the same error.

-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to