frappe / chat

Modern Chat App for Frappe
Other
103 stars 124 forks source link

AttributeError: type object 'datetime.time' has no attribute 'fromisoformat' #28

Open aditsanghvi opened 2 years ago

aditsanghvi commented 2 years ago

running this error after installing it to my site

ubuntu version 18.04 python3 version 3.6.9

App Versions

{
    "chat": "0.0.1",
    "erpnext": "13.17.0",
    "frappe": "13.17.1"
}

Route

Workspaces/Home

Trackeback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 68, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 31, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 67, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1208, in call
    return fn(*args, **newargs)
  File "apps/chat/chat/api/config.py", line 22, in settings
    config = {**config, **get_chat_settings()}
  File "apps/chat/chat/utils/__init__.py", line 97, in get_chat_settings
    start_time = datetime.time.fromisoformat(chat_settings.start_time)
AttributeError: type object 'datetime.time' has no attribute 'fromisoformat'

Request Data

{
    "type": "GET",
    "args": {
        "token": ""
    },
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/chat.api.config.settings"
}

Response Data

{
    "exception": "AttributeError: type object 'datetime.time' has no attribute 'fromisoformat'"
}
phot0n commented 2 years ago

python3 version 3.6.9

the datetime.time.fromisoformat is not available in python < 3.7, as mentioned in their docs

can you please try upgrading the python version?

aditsanghvi commented 2 years ago

After Updating python to 3.7, my bench framework stop stops wroking and when I downgrade back to 3.6.9 my bench framework starts working again

ankush commented 2 years ago

@phot0n we technically support 3.6 on version 13 so it has to be fixed 😅

@aditsanghvi I am not sure how you've upgraded the version. Upgrading bench's version also requires swapping env (virtualenvironment)

bhavesh95863 commented 2 years ago

https://github.com/frappe/chat/pull/34

ParasKumarGupta commented 1 year ago

you can use datetime.strptime(chat_settings.start_time,"specify_format")