Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

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

Open
aditsanghvi opened this issue Dec 26, 2021 · 5 comments

Comments

@aditsanghvi
Copy link

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
Copy link
Contributor

phot0n commented Jan 6, 2022

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
Copy link
Author

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
Copy link
Member

ankush commented Jan 10, 2022

@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
Copy link

#34

@ParasKumarGupta
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants