opned() for text not binary #1

Open
wants to merge 2 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+1 −1
Split
Viewing a subset of changes. View all
Prev

python 3 needs file opned for text, not binary/bytes

tested with:    with open('/etc/hostname', 'wt') as f:
  • Loading branch information...
commit 0022fb1f424168f60ac2a34c37e99701b1bf7137 @CarlFK committed Dec 14, 2016
View
@@ -19,7 +19,7 @@ def update_hostname():
if not hostname:
return
- with open('/etc/hostname', 'wb') as f:
+ with open('/etc/hostname', 'w') as f:
f.write(hostname)
subprocess.check_call(['hostname', hostname])