File tree 1 file changed +3
-2
lines changed
src/pip/_internal/operations 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 5
5
# mypy: strict-optional=False
6
6
7
7
import email .errors
8
+ import gzip
8
9
import json
9
10
import mimetypes
10
11
import os
@@ -437,7 +438,7 @@ def _fetch_cached_metadata(
437
438
try :
438
439
cached_path = self ._metadata_cache .cache_path (req .link )
439
440
os .makedirs (str (cached_path .parent ), exist_ok = True )
440
- with cached_path .open ("rb " ) as f :
441
+ with gzip .open (cached_path , mode = "rt" , encoding = "utf-8 " ) as f :
441
442
logger .debug (
442
443
"found cached metadata for link %s at %s" , req .link , f .name
443
444
)
@@ -466,7 +467,7 @@ def _cache_metadata(
466
467
try :
467
468
cached_path = self ._metadata_cache .cache_path (req .link )
468
469
os .makedirs (str (cached_path .parent ), exist_ok = True )
469
- with cached_path .open ("w " ) as f :
470
+ with gzip .open (cached_path , mode = "wt" , encoding = "utf-8 " ) as f :
470
471
cacheable_dist = CacheableDist .from_dist (req .link , metadata_dist )
471
472
args = cacheable_dist .to_json ()
472
473
logger .debug ("caching metadata for link %s at %s" , req .link , f .name )
You can’t perform that action at this time.
0 commit comments