mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
pygettext: explicitly open files as utf-8
When running it through SSH, I couldn't open files with non-ascii chars.
This commit is contained in:
parent
c1cfa86ad1
commit
0b00171655
@ -378,7 +378,7 @@ def main(source_files, outpath, keywords=None):
|
||||
# initialize list of strings to exclude
|
||||
if options.excludefilename:
|
||||
try:
|
||||
fp = open(options.excludefilename)
|
||||
fp = open(options.excludefilename, encoding='utf-8')
|
||||
options.toexclude = fp.readlines()
|
||||
fp.close()
|
||||
except IOError:
|
||||
@ -392,7 +392,7 @@ def main(source_files, outpath, keywords=None):
|
||||
for filename in source_files:
|
||||
if options.verbose:
|
||||
print('Working on %s' % filename)
|
||||
fp = open(filename)
|
||||
fp = open(filename, encoding='utf-8')
|
||||
closep = 1
|
||||
try:
|
||||
eater.set_filename(filename)
|
||||
@ -408,7 +408,7 @@ def main(source_files, outpath, keywords=None):
|
||||
if closep:
|
||||
fp.close()
|
||||
|
||||
fp = open(options.outfile, 'w')
|
||||
fp = open(options.outfile, 'w', encoding='utf-8')
|
||||
closep = 1
|
||||
try:
|
||||
eater.write(fp)
|
||||
|
Loading…
x
Reference in New Issue
Block a user