mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-02 11:01:14 +02:00
Merge pull request #1246 from kinvolk/dongsu/ca-certificates-utf8
app-misc/ca-certificates: consider system encoding when opening file
This commit is contained in:
commit
4fb2be88fb
@ -124,7 +124,8 @@ for obj in objects:
|
||||
fname = fname.encode('latin1').decode('unicode_escape').encode('latin1').decode('utf8')
|
||||
except (UnicodeEncodeError, UnicodeDecodeError):
|
||||
pass
|
||||
f = open(fname, 'w')
|
||||
|
||||
f = open(fname.encode(encoding=sys.getfilesystemencoding(), errors="ignore"), 'w')
|
||||
f.write("-----BEGIN CERTIFICATE-----\n")
|
||||
# obj['CKA_VALUE'] is a string of octals like '\060\311…',
|
||||
# with a number not greater than octal 377 (which is 255,
|
||||
|
Loading…
x
Reference in New Issue
Block a user