openbabel / openbabel

Open Babel is a chemical toolbox designed to speak the many languages of chemical data.
http://openbabel.org/
GNU General Public License v2.0
1.08k stars 414 forks source link

On Windows (using Pybel) conversion from SDF to SMI segs #796

Closed openbabel-bot closed 7 years ago

openbabel-bot commented 16 years ago

If I read the first entry in head.sdf (including in OB distribution), and write it out as SMI, I get a segfault, but only on Windows. I can read a SMI string, and write it out as SMI, no problem. This wasn't a problem in OB2.1.

import pybel pybel.readfile("sdf", "head.sdf").next().write("sdf") 'NSC 1\n OpenBabel07100814033D\nCORINA 2.61 0041 25.10.2001\n 15 15 0 0 0 0 0 0 0 0999 V2000\n 0.0021 -0.0041 0.0020 O 0 0 0 0 0\n ... ... 1 0 0 0\n 9 15 1 0 0 0\nM END\n> \n1\n\n$$$$\n' pybel.readfile("sdf", "head.sdf").next().write("can") 'O=C1C=CC(=O)C(=C1)C\tNSC 1\n' pybel.readfile("sdf", "head.sdf").next().write("smi")

Segfault (only on Windows)

Reported by: @baoilleach

openbabel-bot commented 16 years ago

Logged In: NO

Chris - could you take a look at this when you have a chance. I'd like to rerelease Pybel once this is fixed...not being able to write SMI fouls up a lot of the basic functionality...

Original comment by: nobody

openbabel-bot commented 16 years ago

Logged In: YES user_id=1189615 Originator: NO

Are you using the release code? There was a SMILES bug in SVN code shortly before release, but it all works fine for me now.

I used SVN head code to build the PythonOBF project, copied openbabel.py _openbabel.pyd pybel.py and head.sdf into the folder with OpenBabel 2.2.0 from OpenBabel2.2.0_Windows_Installer2.exe , set PYTHONPATH there - and your example works ok.

Chris

Original comment by: @chrismorl

openbabel-bot commented 16 years ago

Logged In: NO

Thanks for looking into this. Sorry if it's been a red herring.

It's possible that I could be getting a bit mixed up as the cinfony Pybel and the openbabel Pybel are a bit out of synch (the cinfony one is a week older than the release). I will download and test the released openbabel Pybel.

Original comment by: nobody

openbabel-bot commented 16 years ago

Logged In: YES user_id=850620 Originator: YES

Sorry about that Chris. It works for me after reinstalling from the released Pybel.

Original comment by: @baoilleach