Skip to content
Snippets Groups Projects

Fix KeyError for SVG without xmlns tag

Merged Romain requested to merge rmnvgr/mat2:fix-key-error-for-svg-without-xmlns into master

Some SVG optimizers remove the xmlns tag.

When retrieving metadata for SVG files, the parser wants to remove the Xmlns key from the dict if it is the valid value. However, it sets the default value of the get method to the valid value, so it will try to remove the key even if it doesn't exists, throwing an unhandled KeyError value.

This MR removes the default value of the get method so that the parser doesn't try to remove the Xmlns key with SVG files without the xmlns tag.

Merge request reports

Pipeline #49022 failed

Pipeline failed for 1b361ec2 on rmnvgr:fix-key-error-for-svg-without-xmlns

Approved by

Merged by jvoisinjvoisin 4 years ago (Nov 13, 2020 11:09am UTC)

Merge details

  • Changes merged into master with 1b361ec2.
  • Did not delete the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • jvoisin approved this merge request

    approved this merge request

  • Unfortunately, it seems that it's breaking the testsuite, at least on my local setup, but it seems that I've got things wrong on my side. I'll investigate this week-end :)

    Edited by jvoisin
  • merged

  • Author Contributor

    Yes I saw that, but didn't take the time to look into it either! But when running the unit tests I didn't see anything wrong related to SVGs, so I'd say it's a pretty safe change.

Please register or sign in to reply
Loading