You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
greglandrum
changed the title
MolFromSmiles and MolFromSmarts incorrectly accepting SMILES/SMARTS with spaces
MolFromSmiles and MolFromSmarts incorrectly accepting input with spaces
Sep 13, 2021
After spending some time working on and thinking about this, I'm reluctant to make this change in the default behavior.
It's not hard to imagine that there's a lot of code out there which is perfectly happily working with having SMILES like NON sense parse without errors.
What I think I'm going to do is change the default value of {Smiles,Smarts}ParseParams::parseName to true, then these will both parse without problems by default, but if you want them to generate errors you can set parseName to false
Historically, The RDKit used to strip any trailing whitespace, after a bit of debate, this behavior was changed here as the parser would just stop at the whitespace anyway.
The commit doesn't reflect that change in the merge
To Reproduce
Here's the demo using 2021.03.5:
the same thing happens on master with both
MolFromSmiles
andMolFromSmarts
.Expected behavior
The default setting for
SmilesParserParams::strictCXSMILES
isTrue
, so both of these should fail.Configuration (please complete the following information):
The text was updated successfully, but these errors were encountered: