@@ -162,7 +162,7 @@ def main(argv=None) -> int:
162162
163163 config = {}
164164 if os .path .exists (os .path .expanduser (args .config )):
165- with open (os .path .expanduser (args .config )) as c :
165+ with open (os .path .expanduser (args .config ), encoding = 'UTF-8' ) as c :
166166 config = json .load (c )
167167 config_override = vars (args )
168168 for key in config_override .keys () & config_override .keys ():
@@ -187,8 +187,11 @@ def main(argv=None) -> int:
187187 raise ClientException (msg = 'No expires_in in device_auth' )
188188
189189 # Adding the user code to the URL is convenient, but not as secure as it could be
190- log .info (f'Please visit { device_auth ["verification_uri" ]} within { device_auth ["expires_in" ]} seconds and '
191- f'enter code { device_auth ["user_code" ]} . Or just visit { device_auth ["verification_uri_complete" ]} ' )
190+ log .info ('Please visit {} within {} seconds and enter code {}. Or just visit {}' ,
191+ device_auth ['verification_uri' ],
192+ device_auth ['expires_in' ],
193+ device_auth ['user_code' ],
194+ device_auth ['verification_uri_complete' ])
192195
193196 auth = oidc_check_auth (config , discovery , device_auth )
194197 log .info ('Authenticated' )
@@ -198,7 +201,7 @@ def main(argv=None) -> int:
198201
199202 resp = requests .get ('http://127.0.0.1:5000/api/greeting/v3/' ,
200203 headers = {'Authorization' : f'Bearer { auth ["id_token" ]} ' })
201- log .info (f 'Status Code: { resp .status_code } ' )
204+ log .info ('Status Code: {}' , resp .status_code )
202205 log .info (resp .content )
203206
204207 return 0
0 commit comments