@@ -157,7 +157,7 @@ def get(self, key: str, default):
157157 """
158158 path = self ._getvaluepath (key )
159159 try :
160- with path .open ("r" ) as f :
160+ with path .open ("r" , encoding = "UTF-8" ) as f :
161161 return json .load (f )
162162 except (ValueError , OSError ):
163163 return default
@@ -184,9 +184,9 @@ def set(self, key: str, value: object) -> None:
184184 return
185185 if not cache_dir_exists_already :
186186 self ._ensure_supporting_files ()
187- data = json .dumps (value , indent = 2 )
187+ data = json .dumps (value , ensure_ascii = False , indent = 2 )
188188 try :
189- f = path .open ("w" )
189+ f = path .open ("w" , encoding = "UTF-8" )
190190 except OSError :
191191 self .warn ("cache could not write path {path}" , path = path , _ispytest = True )
192192 else :
@@ -196,7 +196,7 @@ def set(self, key: str, value: object) -> None:
196196 def _ensure_supporting_files (self ) -> None :
197197 """Create supporting files in the cache dir that are not really part of the cache."""
198198 readme_path = self ._cachedir / "README.md"
199- readme_path .write_text (README_CONTENT )
199+ readme_path .write_text (README_CONTENT , encoding = "UTF-8" )
200200
201201 gitignore_path = self ._cachedir .joinpath (".gitignore" )
202202 msg = "# Created by pytest automatically.\n *\n "
0 commit comments