Skip to content

fix: decode negative xsd:duration as seconds, not days#1493

Open
Noethix55555 wants to merge 1 commit into
mvantellingen:mainfrom
Noethix55555:fix/negative-duration-seconds
Open

fix: decode negative xsd:duration as seconds, not days#1493
Noethix55555 wants to merge 1 commit into
mvantellingen:mainfrom
Noethix55555:fix/negative-duration-seconds

Conversation

@Noethix55555

Copy link
Copy Markdown

Summary

Duration.pythonvalue decoded negative xsd:duration values with the wrong unit. The PT- workaround passed result.total_seconds() into timedelta's positional days argument, so PT-30S decoded as -30 days instead of -30 seconds (off by 86400). This passes the value as seconds=.

Added a regression test in tests/test_xsd_builtins.py (TestDuration.test_pythonvalue_negative). Full suite passes (473 passed, 17 pre-existing network skips).

Closes #1492.

The PT- workaround passed total_seconds() into timedelta's positional days argument, so PT-30S decoded as -30 days instead of -30 seconds (off by 86400). Pass it as seconds=.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Negative xsd:duration decoded as days instead of seconds

1 participant