File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1616import re
1717from time import time
1818import warnings
19+ from io import open as io_open
1920
2021from .. import CondaError
2122from .._vendor .auxlib .ish import dals
@@ -226,7 +227,7 @@ def _load(self):
226227 if not isdir (dirname (self .cache_path_json )):
227228 mkdir_p (dirname (self .cache_path_json ))
228229 try :
229- with open (self .cache_path_json , 'w' ) as fh :
230+ with io_open (self .cache_path_json , 'w' ) as fh :
230231 fh .write (raw_repodata_str or '{}' )
231232 except (IOError , OSError ) as e :
232233 if e .errno in (EACCES , EPERM ):
@@ -550,12 +551,12 @@ def maybe_decompress(filename, resp_content):
550551
551552 # add extra values to the raw repodata json
552553 if json_str and json_str != "{}" :
553- raw_repodata_str = "%s, %s" % (
554+ raw_repodata_str = u "%s, %s" % (
554555 json .dumps (saved_fields )[:- 1 ], # remove trailing '}'
555556 json_str [1 :] # remove first '{'
556557 )
557558 else :
558- raw_repodata_str = json .dumps (saved_fields )
559+ raw_repodata_str = ensure_text_type ( json .dumps (saved_fields ) )
559560 return raw_repodata_str
560561
561562
You can’t perform that action at this time.
0 commit comments