Mercurial > hg > gcmultimerge
comparison multimerge.py @ 45:035be8a9e982
Force reading of configuration in Unicode UTF-8.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 05 Jul 2016 14:25:22 +0300 |
parents | e30f4647913d |
children | 51c87abe5a1e |
comparison
equal
deleted
inserted
replaced
44:e30f4647913d | 45:035be8a9e982 |
---|---|
9 ### | 9 ### |
10 import os | 10 import os |
11 import sys | 11 import sys |
12 import signal | 12 import signal |
13 import re | 13 import re |
14 import codecs | |
14 #import time | 15 #import time |
15 #import datetime | 16 #import datetime |
16 | 17 |
17 import smtplib | 18 import smtplib |
18 from email.mime.text import MIMEText | 19 from email.mime.text import MIMEText |
280 ## Read, parse and validate configuration file | 281 ## Read, parse and validate configuration file |
281 if len(sys.argv) > 1: | 282 if len(sys.argv) > 1: |
282 gcm_debug("Reading configuration from '{0}'.".format(sys.argv[1])) | 283 gcm_debug("Reading configuration from '{0}'.".format(sys.argv[1])) |
283 try: | 284 try: |
284 cfgparser = ConfigParser.RawConfigParser() | 285 cfgparser = ConfigParser.RawConfigParser() |
285 cfgparser.read(sys.argv[1]) | 286 cfgparser.readfp(codecs.open(sys.argv[1], "r", "UTF-8")) |
286 except Exception as e: | 287 except Exception as e: |
287 gcm_fatal("Failed to read configuration file '{0}': {1}".format(sys.argv[1], str(e))) | 288 gcm_fatal("Failed to read configuration file '{0}': {1}".format(sys.argv[1], str(e))) |
288 | 289 |
289 # Check that the required section exists | 290 # Check that the required section exists |
290 section = "gcm" | 291 section = "gcm" |