agent-Python-RobotFramework icon indicating copy to clipboard operation
agent-Python-RobotFramework copied to clipboard

Getting Error with robot framework listener -Calling method 'log_message' of listener 'robotframework_reportportal.listener' failed: TypeError: Object of type _PresenceSentinel is not JSON serializable

Open Akaaav opened this issue 1 year ago • 3 comments

Error information TypeError: Object of type _PresenceSentinel is not JSON serializable

[ ERROR ] Calling method 'log_message' of listener 'robotframework_reportportal.listener' failed: TypeError: Object of type _PresenceSentinel is not JSON serializable

Errorstack :

Traceback (most recent call last): File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\reportportal_client\core\rp_requests.py", line 128, in make return RPResponse(self.session_method(self.url, data=self.data, json=self.json, files=self.files,

File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, **kwargs)

File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 575, in request
prep = self.prepare_request(req)

File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 486, in prepare_request p.prepare( File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\models.py", line 371, in prepare
self.prepare_body(data, files, json) File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\models.py", line 511, in prepare_body body = complexjson.dumps(json, allow_nan=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\json_init_.py", line 238, in dumps **kw).encode(obj) ^^^^^^^^^^^ File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\json\encoder.py", line 200, in encode chunks = self.iterencode(o, _one_shot=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\json\encoder.py", line 258, in iterencode return _iterencode(o, 0) ^^^^^^^^^^^^^^^^^ File "C:\Users\xxxx\AppData\Local\Programs\Python\Python312\Lib\json\encoder.py", line 180, in default raise TypeError(f'Object of type {o.class.name} '

TypeError: Object of type _PresenceSentinel is not JSON serializable

[ ERROR ] Calling method 'log_message' of listener 'robotframework_reportportal.listener' failed: TypeError: Object of type _PresenceSentinel is not JSON serializable [ WARN ] ReportPortal None request failed

Command passed: py run.py -i tag -v SUT_HOST_IP:x.x.x.x -L TRACE --listener robotframework_reportportal.listener -v RP_ENDPOINT:"https://hostname" -v RP_API_KEY:"key" -v RP_LAUNCH:"Testing" -v RP_PROJECT:"Test"

Version used:

Python : 3.12.0 Robot framework: 7.0 robotframework-reportportal : 5.5.3 reportportal-client: 5.5.6

Akaaav avatar May 24 '24 08:05 Akaaav