mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix Python 2 TypeError: write() argument 1 must be unicode, not str (see issue #2856)
This commit is contained in:
@ -32,6 +32,11 @@ def write_file(name, data):
|
||||
try:
|
||||
with open(name, 'w', encoding='utf-8') as f:
|
||||
# write the data
|
||||
try:
|
||||
# Python 2
|
||||
f.write(data.decode('utf-8'))
|
||||
except Exception as e:
|
||||
# Python 3
|
||||
f.write(data)
|
||||
except IOError as e:
|
||||
(errno, strerror) = e.args
|
||||
|
Reference in New Issue
Block a user