Skip to content

Commit

Permalink
force en_US.UTF-8 locale in CLAM wrapper (for all nextflow subprocesses)
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Jun 6, 2018
1 parent f9965ed commit 8c12c21
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions webservice/picclservice/picclservice_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import os
import glob
import shutil
import locale

#import CLAM-specific modules. The CLAM API makes a lot of stuff easily accessible.
import clam.common.data
Expand Down Expand Up @@ -46,8 +47,10 @@
run_piccl = "nextflow run LanguageMachines/PICCL/"
print("Running PICCL mediated by Nextflow",file=sys.stderr)

print("System default encoding: ", sys.getdefaultencoding(), file=sys.stderr)

print("System default encoding: ", sys.getdefaultencoding(), file=sys.stderr)
print("Forcing en_US.UTF-8 locale...", file=sys.stderr)
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')

#If you make use of CUSTOM_FORMATS, you need to import your service configuration file here and set clam.common.data.CUSTOM_FORMATS
#Moreover, you can import any other settings from your service configuration file as well:
Expand All @@ -58,7 +61,7 @@
clamdata = clam.common.data.getclamdata(datafile)

if 'debug' in clamdata and clamdata['debug']:
print("Locale information: ", file=sys.stderr)
print("Locale information (will force en_US.UTF-8): ", file=sys.stderr)
os.system("locale >&2", file=sys.stderr)

#You now have access to all data. A few properties at your disposition now are:
Expand Down

0 comments on commit 8c12c21

Please sign in to comment.