@@ -73,16 +73,16 @@ def get_buffer(remote_path: str, base_path: str = HTTP_SEC_HOST):
7373 if 'Last-Modified' in r .headers :
7474 try :
7575 last_modified_date = dateutil .parser .parse (r .headers ['Last-Modified' ]).date ()
76- except Exception as e :
77- logger .error ("Unable to update last modified date: {0}" .format (remote_path , failures , e ))
76+ except Exception as e : # pylint: disable=broad-except
77+ logger .error ("Unable to update last modified date for {0}: {1} " .format (remote_path , e ))
7878
7979 file_buffer = r .content
8080 complete = True
8181
8282 # Sleep if set gt0
8383 if HTTP_SLEEP_DEFAULT > 0 :
8484 time .sleep (HTTP_SLEEP_DEFAULT )
85- except Exception as e :
85+ except Exception as e : # pylint: disable=broad-excepts
8686 # Handle and sleep
8787 if failures < len (HTTP_FAIL_SLEEP ):
8888 logger .warning ("File {0}, failure {1}: {2}" .format (remote_path , failures , e ))
@@ -114,7 +114,7 @@ def list_path(remote_path: str):
114114 """
115115 # Log entrance
116116 logger .info ("Retrieving directory listing from {0}" .format (remote_path ))
117- remote_buffer , last_modified_date = get_buffer (remote_path )
117+ remote_buffer , _ = get_buffer (remote_path )
118118
119119 # Parse the index listing
120120 if remote_buffer is None :
@@ -256,7 +256,7 @@ def get_company(cik: Union[int, str]):
256256 encoding = "utf-8" ).decode ("utf-8" )
257257 mailing_address = " " .join (raw_address .splitlines ()[1 :]).strip ()
258258 company_data ["mailing_address" ] = mailing_address
259- except Exception as e :
259+ except Exception as e : # pylint: disable=broad-except
260260 logger .warning ("Unable to parse mailing_address: {0}" .format (e ))
261261 company_data ["mailing_address" ] = None
262262
@@ -265,34 +265,34 @@ def get_company(cik: Union[int, str]):
265265 encoding = "utf-8" ).decode ("utf-8" )
266266 business_address = " " .join (raw_address .splitlines ()[1 :]).strip ()
267267 company_data ["business_address" ] = business_address
268- except Exception as e :
268+ except Exception as e : # pylint: disable=broad-except
269269 logger .warning ("Unable to parse business_address: {0}" .format (e ))
270270 company_data ["business_address" ] = None
271271
272272 try :
273273 company_data ["name" ] = list (list (company_info_div )[2 ])[0 ].text .strip ()
274- except Exception as e :
274+ except Exception as e : # pylint: disable=broad-except
275275 logger .warning ("Unable to parse name: {0}" .format (e ))
276276 company_data ["name" ] = None
277277
278278 try :
279279 ident_info_p = list (list (company_info_div )[2 ])[1 ]
280280 company_data ["sic" ] = list (ident_info_p )[1 ].text
281- except Exception as e :
281+ except Exception as e : # pylint: disable=broad-except
282282 logger .warning ("Unable to parse SIC: {0}" .format (e ))
283283 company_data ["sic" ] = None
284284
285285 try :
286286 ident_info_p = list (list (company_info_div )[2 ])[1 ]
287287 company_data ["state_location" ] = list (ident_info_p )[3 ].text
288- except Exception as e :
288+ except Exception as e : # pylint: disable=broad-except
289289 logger .warning ("Unable to parse SIC: {0}" .format (e ))
290290 company_data ["state_location" ] = None
291291
292292 try :
293293 ident_info_p = list (list (company_info_div )[2 ])[1 ]
294294 company_data ["state_incorporation" ] = list (ident_info_p )[4 ].text
295- except Exception as e :
295+ except Exception as e : # pylint: disable=broad-except
296296 logger .warning ("Unable to parse SIC: {0}" .format (e ))
297297 company_data ["state_incorporation" ] = None
298298
0 commit comments