nickjcroucher / gubbins

Rapid phylogenetic analysis of large samples of recombinant bacterial whole genome sequences using Gubbins
http://nickjcroucher.github.io/gubbins/
GNU General Public License v2.0
159 stars 49 forks source link

File names with spaces cause error #394

Closed johnlees closed 4 months ago

johnlees commented 4 months ago

Crass to have a space in paths I know, but technically permitted since Windows 95 I believe:

Running Gubbins to detect SNPs...
gubbins /Users/jlees/Documents/EBI/SKA project/pmen1/tmpxt6aiqem/pmen1.aln
Error: File '/Users/jlees/Documents/EBI/SKA' does not exist

With gubbins 3.3.1

Need to add quotes in the subcommand I guess?

johnlees commented 4 months ago

I think change https://github.com/nickjcroucher/gubbins/blob/master/python/gubbins/common.py#L227

gubbins_command = " ".join([gubbins_exec, input_args.alignment_filename])

to

gubbins_command = f"{gubbins_exec} \"{input_args.alignment_filename}\""
nickjcroucher commented 4 months ago

Thank you! Incorporated in #397.