Modify ↓
Opened 21 months ago
Closed 21 months ago
#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)
Note: See
TracTickets for help on using
tickets.
In 18515: