We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3119831 commit 636f23cCopy full SHA for 636f23c
readthedocs/projects/utils.py
@@ -10,7 +10,7 @@
10
11
import redis
12
import six
13
-from builtins import object
+from builtins import object, open
14
from django.conf import settings
15
from django.core.cache import cache
16
from httplib2 import Http
@@ -121,10 +121,10 @@ def safe_write(filename, contents):
121
dirname = os.path.dirname(filename)
122
if not os.path.exists(dirname):
123
os.makedirs(dirname)
124
- with open(filename, 'w') as fh:
125
- fh.write(contents.encode('utf-8', 'ignore'))
126
- fh.close()
127
+ with open(filename, 'w', encoding='utf-8', errors='ignore') as fh:
+ fh.write(contents)
+ fh.close()
128
129
def purge_version(version, mainsite=False, subdomain=False, cname=False):
130
varnish_servers = getattr(settings, 'VARNISH_SERVERS', None)
0 commit comments