Update doctype value not working FrappeClient Python API

Hi,

I’m trying to update a doctype value via the FrappeClient Python API. Getting a value works fine. However, when I try to update a value I get an error. I followed the steps described on GitHub - frappe/frappe-client: Python library to use Frappe API

My code:

from frappeclient import FrappeClient

client = FrappeClient(“https://example.com”)
client.authenticate(“my_api_key”, “my_api_secret”)
doc = client.get_doc(‘Item’, ‘Aluminium’)
print(doc[‘valuation_rate’])
doc[‘valuation_rate’] = 1.8
client.update(doc)

The response:

1.6
Traceback (most recent call last):
File “d:\Work\Internal\ERPNextAPI.py”, line 35, in
client.update(doc)
File “c:\users\ricka\frappe-client\frappeclient\frappeclient.py”, line 116, in update
return self.post_process(res)
File “c:\users\ricka\frappe-client\frappeclient\frappeclient.py”, line 285, in post_process
raise FrappeException(rjson[‘exc’])
frappeclient.frappeclient.FrappeException: [“Traceback (most recent call last):\n File “apps/frappe/frappe/app.py”, line 69, in application\n response = frappe.api.handle()\n File “apps/frappe/frappe/api.py”, line 84, in handle\n data = get_request_form_data()\n File “apps/frappe/frappe/api.py”, line 160, in get_request_form_data\n return frappe.parse_json(data)\n File “apps/frappe/frappe/init.py”, line 2178, in parse_json\n return parse_json(val)\n File “apps/frappe/frappe/utils/init.py”, line 783, in parse_json\n val = json.loads(val)\n File “/usr/lib/python3.7/json/init.py”, line 348, in loads\n return _default_decoder.decode(s)\n File “/usr/lib/python3.7/json/decoder.py”, line 337, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n File “/usr/lib/python3.7/json/decoder.py”, line 355, in raw_decode\n raise JSONDecodeError(“Expecting value”, s, err.value) from None\njson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n”]

Does anybody know what I’m doing wrong and how to solve this?

Thanks