Skip to content

Commit 63ef050

Browse files
committed
Open files with encoding='utf-8' in release script
1 parent 2f73c33 commit 63ef050

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dev-tools/build_release.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ def create_release_branch(remote, src_branch, release):
149149
def process_file(file_path, line_callback):
150150
fh, abs_path = tempfile.mkstemp()
151151
modified = False
152-
with open(abs_path,'w') as new_file:
153-
with open(file_path) as old_file:
152+
with open(abs_path,'w', encoding='utf-8') as new_file:
153+
with open(file_path, encoding='utf-8') as old_file:
154154
for line in old_file:
155155
new_line = line_callback(line)
156156
modified = modified or (new_line != line)
@@ -266,7 +266,7 @@ def wait_for_node_startup(host='127.0.0.1', port=9200,timeout=15):
266266
# Returns the next version string ie. 0.90.7
267267
def find_release_version(src_branch):
268268
run('git checkout %s' % src_branch)
269-
with open('pom.xml') as file:
269+
with open('pom.xml', encoding='utf-8') as file:
270270
for line in file:
271271
match = re.search(r'<version>(.+)-SNAPSHOT</version>', line)
272272
if match:
@@ -397,7 +397,7 @@ def publish_artifacts(artifacts, base='elasticsearch/elasticsearch', dry_run=Tru
397397
def print_sonartype_notice():
398398
settings = os.path.join(os.path.expanduser('~'), '.m2/settings.xml')
399399
if os.path.isfile(settings):
400-
with open(settings) as settings_file:
400+
with open(settings, encoding='utf-8') as settings_file:
401401
for line in settings_file:
402402
if line.strip() == '<id>sonatype-nexus-snapshots</id>':
403403
# moving out - we found the indicator no need to print the warning
@@ -530,4 +530,4 @@ def check_s3_credentials():
530530
# we delete this one anyways
531531
run('git branch -D %s' % (release_branch(release_version)))
532532
if smoke_test_version:
533-
download_and_verify(smoke_test_version, artifact_names(smoke_test_version))
533+
download_and_verify(smoke_test_version, artifact_names(smoke_test_version))

0 commit comments

Comments
 (0)