@@ -108,10 +108,9 @@ def wheel_image(self, for_py_version, name):
108
108
109
109
110
110
class JSONStoreDisk (ContentStore , ABC ):
111
- def __init__ (self , in_folder , key , msg , msg_args ) -> None :
111
+ def __init__ (self , in_folder , key , msg_args ) -> None :
112
112
self .in_folder = in_folder
113
113
self .key = key
114
- self .msg = msg
115
114
self .msg_args = (* msg_args , self .file )
116
115
117
116
@property
@@ -130,7 +129,7 @@ def read(self):
130
129
except Exception : # noqa: BLE001, S110
131
130
pass
132
131
else :
133
- LOGGER .debug ("got %s from %s" , self . msg , self .msg_args )
132
+ LOGGER .debug ("got %s %s from %s" , * self .msg_args )
134
133
return data
135
134
if bad_format :
136
135
with suppress (OSError ): # reading and writing on the same file may cause race on multiple processes
@@ -139,7 +138,7 @@ def read(self):
139
138
140
139
def remove (self ):
141
140
self .file .unlink ()
142
- LOGGER .debug ("removed %s at %s" , self . msg , self .msg_args )
141
+ LOGGER .debug ("removed %s %s at %s" , * self .msg_args )
143
142
144
143
@contextmanager
145
144
def locked (self ):
@@ -150,22 +149,21 @@ def write(self, content):
150
149
folder = self .file .parent
151
150
folder .mkdir (parents = True , exist_ok = True )
152
151
self .file .write_text (json .dumps (content , sort_keys = True , indent = 2 ), encoding = "utf-8" )
153
- LOGGER .debug ("wrote %s at %s" , self . msg , self .msg_args )
152
+ LOGGER .debug ("wrote %s %s at %s" , * self .msg_args )
154
153
155
154
156
155
class PyInfoStoreDisk (JSONStoreDisk ):
157
156
def __init__ (self , in_folder , path ) -> None :
158
157
key = sha256 (str (path ).encode ("utf-8" )).hexdigest ()
159
- super ().__init__ (in_folder , key , "python info of %s " , ( path , ))
158
+ super ().__init__ (in_folder , key , ( "python info of" , path ))
160
159
161
160
162
161
class EmbedDistributionUpdateStoreDisk (JSONStoreDisk ):
163
162
def __init__ (self , in_folder , distribution ) -> None :
164
163
super ().__init__ (
165
164
in_folder ,
166
165
distribution ,
167
- "embed update of distribution %s" ,
168
- (distribution ,),
166
+ ("embed update of distribution" , distribution ),
169
167
)
170
168
171
169
0 commit comments