Skip to content

Cleanup reported issues#364

Merged
chennes merged 2 commits into
FreeCAD:devfrom
chennes:miscSmallCleanup
May 13, 2026
Merged

Cleanup reported issues#364
chennes merged 2 commits into
FreeCAD:devfrom
chennes:miscSmallCleanup

Conversation

@chennes
Copy link
Copy Markdown
Member

@chennes chennes commented Feb 22, 2026

Remove fallback to regular Python XML parser, forcing use of defusedxml, and eliminate backwards-compatibility of SHA1 generator for Python 3.8, adding the usedforsecurity=False flag.

Copilot AI review requested due to automatic review settings February 22, 2026 22:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request performs security and compatibility cleanup by removing backward-compatibility code. It enforces the use of defusedxml for secure XML parsing (removing the fallback to the standard library's potentially vulnerable XML parser) and drops Python 3.8 compatibility for SHA1 hash generation. Additionally, it adds URL scheme validation to ensure only HTTP(S) URLs are processed, strengthening security posture.

Changes:

  • Removed try/except fallback from defusedxml to xml.etree.ElementTree, making defusedxml mandatory
  • Removed Python 3.8 compatibility code for SHA1 hash generation with usedforsecurity=False parameter
  • Added URL scheme validation to reject non-HTTP(S) schemes in blocking_get() and translation API requests

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
addonmanager_workers_startup.py Changed import to use ParseError alias, removed Python 3.8 SHA1 fallback code
addonmanager_utilities.py Added URL scheme validation to reject non-HTTP(S) URLs
addonmanager_metadata.py Removed fallback import, now requires defusedxml
addonmanager_icon_utilities.py Removed fallback import, now requires defusedxml
Resources/translations/run_translation_cycle.py Added HTTPS validation for API requests and download URLs
AddonCatalogCacheCreator.py Changed import to use ParseError alias
AddonCatalog.py Changed import to use ParseError alias
Addon.py Changed import to use ParseError alias

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Resources/translations/run_translation_cycle.py
Comment thread Resources/translations/run_translation_cycle.py
Comment thread Resources/translations/run_translation_cycle.py
Comment thread addonmanager_utilities.py Outdated
@chennes chennes force-pushed the miscSmallCleanup branch from aaf98c9 to 4cd7640 Compare May 13, 2026 19:59
@chennes chennes force-pushed the miscSmallCleanup branch from 9cd4acc to 6ea5407 Compare May 13, 2026 20:01
@chennes chennes merged commit 8c7def6 into FreeCAD:dev May 13, 2026
7 checks passed
@chennes chennes deleted the miscSmallCleanup branch May 13, 2026 20:03
@chennes chennes added the release to main Trigger an Action to create a PR backporting to `main` label May 13, 2026
@github-actions
Copy link
Copy Markdown

Backport failed for main, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin main
git worktree add -d .worktree/backport-364-to-main origin/main
cd .worktree/backport-364-to-main
git switch --create backport-364-to-main
git cherry-pick -x 157e586cc699aa501865684308ef44f71466519d 6ea54077a3eb5a6494f0483a009a399430fb7eaf

1 similar comment
@github-actions
Copy link
Copy Markdown

Backport failed for main, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin main
git worktree add -d .worktree/backport-364-to-main origin/main
cd .worktree/backport-364-to-main
git switch --create backport-364-to-main
git cherry-pick -x 157e586cc699aa501865684308ef44f71466519d 6ea54077a3eb5a6494f0483a009a399430fb7eaf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release to main Trigger an Action to create a PR backporting to `main`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants