probemon icon indicating copy to clipboard operation
probemon copied to clipboard

Fixed the error: type object 'datetime.datetime' has no attribute 'da…

Open haccks opened this issue 8 years ago • 3 comments

Running probemon.py on Raspberry pi3 with Kali Linux as OS getting error:

root@kali:~# python probemon.py -i wlan1  
Traceback (most recent call last):
  File "probemon.py", line 99, in <module>
    main()
  File "probemon.py", line 96, in main
    sniff(iface=args.interface, prn=built_packet_cb, store=0)
  File "/usr/lib/python2.7/dist-packages/scapy/sendrecv.py", line 620, in sniff
    r = prn(p)
  File "probemon.py", line 37, in packet_callback
    log_time = datetime.datetime.now().isoformat()
 AttributeError: type object 'datetime.datetime' has no attribute 'datetime'` 

Error has been resolved by the suggested changes.

haccks avatar Feb 17 '17 16:02 haccks

you changed the import from "import datetime" to "from datetime import datetime" and you made the error yourself. this fix is not wrong but also not necessary.

alican avatar Mar 13 '17 14:03 alican

Shouldn't it just be "log_time = datetime.now().isoformat()" instead of "log_time = datetime.datetime.now().isoformat()" that is the edit I had to make to avoid this error.

J1mX avatar Sep 07 '18 13:09 J1mX

Shouldn't it just be "log_time = datetime.now().isoformat()" instead of "log_time = datetime.datetime.now().isoformat()" that is the edit I had to make to avoid this error.

How can I find the log_time ? so that then I can edit it ?

ghost avatar Mar 04 '20 09:03 ghost