wangyifang280 / google-safe-browsing

Automatically exported from code.google.com/p/google-safe-browsing
0 stars 0 forks source link

client.py has bad keyword argument, crash #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
 python ./client.py check xxx
/Users/nickgalbreath/googlesafebrowsing/server.py:676: SyntaxWarning: assertion 
is always true, perhaps remove parentheses?
  assert(len(self._prefixes),
/Users/nickgalbreath/googlesafebrowsing/server.py:713: SyntaxWarning: assertion 
is always true, perhaps remove parentheses?
  assert(len(self._prefixes),
/Users/nickgalbreath/googlesafebrowsing/server.py:29: DeprecationWarning: the 
sha module is deprecated; use the hashlib module instead
  import sha
Traceback (most recent call last):
  File "./client.py", line 419, in <module>
    main(sys.argv)
  File "./client.py", line 412, in main
    CheckForUrl(argv[1:])
  File "./client.py", line 395, in CheckForUrl
    update_hook=checker.Updated)
TypeError: __init__() got an unexpected keyword argument 'update_hook'

update_hook should be pre_update_hook or post_update_hook as the ctor is 
defined:

  def __init__(self, ds, apikey, hp=('safebrowsing.clients.google.com', 80),
               ssl_hp=('sb-ssl.google.com', 443), base_path='/safebrowsing',
               use_mac=True, size_limit=None, force_delay=None,
               pre_update_hook=lambda cl: None,
               post_update_hook=lambda cl: None, gethash_server=None,
               update_lists=False, sb_server=None):

Original issue reported on code.google.com by nickgsup...@gmail.com on 27 Jul 2010 at 10:01

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The client won't run due to the fact that 'update_hook' is not a valid input 
parameter for Client.  Changing it to a valid 'pre_update_hook' or 
'post_update_hook' gives:

Message File Name   Line    Position    
Traceback               
    <module>    C:\googlesafebrowsing-opensource-code-v0.2\googlesafebrowsing\client.py 421     
    main    C:\googlesafebrowsing-opensource-code-v0.2\googlesafebrowsing\client.py 414     
    CheckForUrl C:\googlesafebrowsing-opensource-code-v0.2\googlesafebrowsing\client.py 397     
TypeError: __init__() takes at least 3 non-keyword arguments (2 given)              

Original comment by fer...@gmail.com on 28 Oct 2010 at 12:34