File: fix_grep_call.patch

package info (click to toggle)
srst2 0.2.0-14
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,072 kB
  • sloc: python: 3,115; sh: 50; makefile: 25
file content (24 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Author: Andreas Tille <tille@debian.org>
Last-Update: 2017-03-01
Bug-Debian: https://bugs.debian.org/856479
Description: Do not fail if search string contains special shell characters

--- a/scripts/srst2.py
+++ b/scripts/srst2.py
@@ -23,6 +23,7 @@ from argparse import (ArgumentParser, Fi
 import logging
 from subprocess import call, check_output, CalledProcessError, STDOUT
 import os, sys, re, collections, operator
+import subprocess
 from scipy.stats import binom, linregress
 from math import log
 from itertools import groupby
@@ -1499,7 +1500,7 @@ def map_fileSet_to_db(args, sample_name,
 			if args.no_gene_details:
 
 				# get annotation info
-				header_string = os.popen(" ".join(["grep",allele,fasta]))
+				header_string = subprocess.check_output(["grep",allele,fasta])
 				try:
 					header = header_string.read().rstrip().split()
 					header.pop(0) # remove allele name