Skip to content
Snippets Groups Projects

QualifiedSWHID: Fix (de)serialization of 'origin' qualifier

Merged vlorentz requested to merge qualified-swhid-origin into master

Having the escaped URL in swhid.origin is inconsistent with self.path (which is always escaped) and never what we want, because it is only useful while serializing, which is already handled by __str__.

This led to swh-indexer#4738 (closed) where swh-deposit parsed a qualified SWHID, then used .origin to get an origin URL.

Additionally, as serialization always escapes the origin qualifier, this means that deserializing then re-serializing a qualified SWHID would double-escape it.

Finally, fixing this made the test uncover that % was not escaped while serializing, while ; was, leading to incorrect (and ambiguous) escaped URLs.

Merge request reports

Pipeline #8793 passed

Pipeline passed for 9cf7ad9d on qualified-swhid-origin

Merged by Antoine LambertAntoine Lambert 11 months ago (May 15, 2024 2:22pm UTC)

Loading

Pipeline #8797 passed

Pipeline passed for 9cf7ad9d on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading