Skip to content

Commit

Permalink
Enforce UTF-8 encoding on edit of journalfiles by rrd_update script
Browse files Browse the repository at this point in the history
Change-Id: Iae95a52eb6a5e9fe0e084d14ac3cd042e69a1f0c
(cherry picked from commit f23ef7da007ae410cd94ec9a354650c6c48cb368)
  • Loading branch information
Óscar Nájera committed Oct 9, 2019
1 parent 7cbe456 commit 8c6daa4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/update_rrd_fs_names.py
Expand Up @@ -142,7 +142,8 @@ def update_journal(rrdfile, rrdfilenew):
logger.info('- Updating journal file %s', filepath)
new_file = filepath.with_suffix(filepath.suffix + '.new')
try:
with filepath.open('r') as old_jou, new_file.open('w') as new_jou:
with filepath.open('r', encoding="utf-8") as old_jou, new_file.open(
'w', encoding="utf-8") as new_jou:
for line in old_jou:
if rrdfile in line:
line = line.replace(rrdfile, rrdfilenew)
Expand Down

0 comments on commit 8c6daa4

Please sign in to comment.