Skip to content

Commit

Permalink
Do not open token temporary file in binary mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vitodb committed Nov 15, 2023
1 parent f6ddcc2 commit 11c4cd3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ def refresh_entry_token(self, glidein_site, work_dir="/var/lib/gwms-frontend"):
self.logger.debug("identity= %s" % identity)
tkn_str = token_util.create_and_sign_token(pwd_file, scope=scope, duration=duration, identity=identity)
self.logger.debug("tkn_str= %s" % tkn_str)
with tempfile.NamedTemporaryFile(mode="wb", delete=False, dir=tkn_dir) as fd:
with tempfile.NamedTemporaryFile(mode="w", delete=False, dir=tkn_dir) as fd:
os.chmod(fd.name, 0o600)
fd.write(tkn_str)
fd.flush()
Expand Down

0 comments on commit 11c4cd3

Please sign in to comment.