TGAC / KAT

The K-mer Analysis Toolkit (KAT) contains a number of tools that analyse and compare K-mer spectra.
http://www.earlham.ac.uk/kat-tools
GNU General Public License v3.0
206 stars 52 forks source link

Fix: Name clashes between type 'str' and local variable 'str' #91

Closed hdetering closed 6 years ago

hdetering commented 6 years ago

When running kat plot spectra-mx with Python 3.5.4 (Miniconda environment), I got the following error:

(kat) [harry@triploid plecoptera]$ kat plot spectra-mx
Kmer Analysis Toolkit (KAT) V2.4.0

Traceback (most recent call last):
  File "/home/harry/lib/python3.5/site-packages/kat-2.4.0-py3.5.egg/kat/plot/spectra_mx.py", line 224, in <module>
    main()
  File "/home/harry/lib/python3.5/site-packages/kat-2.4.0-py3.5.egg/kat/plot/spectra_mx.py", line 17, in main
    parser.add_argument("matrix_file", type=str,
UnboundLocalError: local variable 'str' referenced before assignment
../lib/include/kat/pyhelper.hpp(159): Throw in function void kat::PyHelper::execute(std::__cxx11::string, int, char**)
Dynamic exception type: boost::exception_detail::clone_impl<kat::KatPythonException>
std::exception::what: std::exception
[kat::KatPythonError*] = Unexpected python error

It looks like there is a name clash between the type str and the variable str declared later in the code. Renaming the local variable fixed the issue.

Cheers, -- Harry

hdetering commented 6 years ago

Happy to help, @maplesond :)