Modify

#14211 closed defect (fixed)

JSON-RPC handles incorrectly microsecond of rfc3339/iso8601 string

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

In additional, timezone offset is ignored....

>>> import io
>>> from tracrpc.json_rpc import json_load
>>> from trac.test import EnvironmentStub, MockRequest
>>> env = EnvironmentStub()
>>> req = MockRequest(env)
>>> payload = b'{"__jsonclass__": ["datetime", "2023-03-02T10:54:07.4"]}'
>>> req.environ['CONTENT_LENGTH'] = str(len(payload))
>>> req.environ['wsgi.input'] = io.BytesIO(payload)
>>> result = json_load(req)
>>> result
datetime.datetime(2023, 3, 2, 10, 54, 7, 4, tzinfo=<FixedOffset "UTC" 0:00:00>)
>>> result.microsecond
4  # ==> should be 400000

Attachments (0)

Change History (1)

comment:1 Changed 13 months ago by Jun Omae

Resolution: fixed
Status: assignedclosed

In 18515:

XmlRpcPlugin: fix handling microsecond of rfc3339 string in JSON-RPC (closes #14211)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.