Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subs file isn't checked for odd non-ascii characters #3

Open
jhill1 opened this issue Feb 9, 2018 · 0 comments
Open

Subs file isn't checked for odd non-ascii characters #3

jhill1 opened this issue Feb 9, 2018 · 0 comments

Comments

@jhill1
Copy link
Member

jhill1 commented Feb 9, 2018

Add the ascii replacer to the import subs file function. Otherwise, you get:

***Error: Failed sbstituting taxa due to unknown error. File a bug report, please!
https://github.com/supertree-toolkit/stk/issues

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/supertree_toolkit-2.0-py2.7.egg/EGG-INFO/scripts/stk", line 1012, in sub_taxa
XML = supertree_toolkit.substitute_taxa(XML,old_taxa,new_taxa,ignoreWarnings=ignoreWarnings,only_existing=only_existing,generic_match=generic)
File "/usr/local/lib/python2.7/dist-packages/supertree_toolkit-2.0-py2.7.egg/EGG-INFO/scripts/../../stk/supertree_toolkit.py", line 472, in substitute_taxa
XML = stk_phyml.swap_tree_in_XML(XML,new_tree,name)
File "/usr/local/lib/python2.7/dist-packages/supertree_toolkit-2.0-py2.7.egg/EGG-INFO/scripts/../../stk/stk_phyml.py", line 785, in swap_tree_in_XML
t.xpath("tree/tree_string/string_value")[0].text = tree
File "src/lxml/lxml.etree.pyx", line 1031, in lxml.etree._Element.text.set (src/lxml/lxml.etree.c:55347)
File "src/lxml/apihelpers.pxi", line 711, in lxml.etree._setNodeText (src/lxml/lxml.etree.c:24667)
File "src/lxml/apihelpers.pxi", line 699, in lxml.etree._createTextNode (src/lxml/lxml.etree.c:24516)
File "src/lxml/apihelpers.pxi", line 1439, in lxml.etree._utf8 (src/lxml/lxml.etree.c:32441)
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters

PS - FIX the typo in the error message

Also, when loading via the GUI, got:
Traceback (most recent call last):
File "/home/jh1889/work/software/supertree-toolkit/autotree/stk_gui/bin/../stk_gui/interface.py", line 2203, in on_import_subs_clicked
dialogs.error_tb(self.main_window,"Error importing sub file:\n"+error)
NameError: global name 'error' is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant