feat: Audit: Modernise codebase to Python 3.9+ idioms#110
feat: Audit: Modernise codebase to Python 3.9+ idioms#110citconv-agents[bot] wants to merge 1 commit intomasterfrom
Conversation
- Replace typing.List, Dict, Tuple, Type, Union, Sequence with builtins and collections.abc equivalents - Convert % string formatting to f-strings throughout src/docx/ - Replace os.path usage with pathlib.Path in api.py, parts/, image/, and opc/phys_pkg.py - Add `from __future__ import annotations` to all source files - Modernise super(ClassName, self) calls to super() All 1921 unit tests and 650 acceptance scenarios pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Security Agent Report SECURITY_PASS Security Review — PR #110SummaryPR #110 is a pure modernization/refactoring PR that updates the codebase to Python 3.9+ idioms. No new functionality is introduced, no new dependencies are added, and no security regressions are present. Changes ReviewedAll changed files were reviewed:
FindingsNo Issues FoundInjection Risks — CLEANXPath queries with f-strings (e.g.
XML construction with f-strings (e.g.
No XXE risk: The existing Path Handling — IMPROVED
Dependencies — CLEANNo new dependencies added. No Secrets — CLEANNo API keys, tokens, passwords, or credentials present anywhere in the diff. Data Exposure — CLEANNo new file I/O patterns, no logging of sensitive data, no changes to serialization behavior. ConclusionAll changes are mechanical modernizations:
No security concerns identified. |
Summary
Implements #82
This PR was automatically generated by the Developer Agent.
Original Issue
Scope
Update the entire codebase to use modern Python 3.9+ patterns, removing legacy compatibility code.
What to Review and Update
Type Hints
typing.Optional[X]withX | Nonetyping.Union[X, Y]withX | Ytyping.List,typing.Dict,typing.Tuple,typing.Setwithlist,dict,tuple,settyping.Sequence,typing.Mappingwithcollections.abcequivalents where neededString Formatting
%formatting and.format()with f-strings where it improves readabilityPath Handling
os.pathusage withpathlib.Pathwhere appropriateOther Modernisations
dict | other_dictmerge syntax (3.9+) where applicable:=) where it simplifies codetype(x) == Ywithisinstance(x, Y)from __future__ import annotationsconsistently for deferred evaluationsixor Python 2 compatibility code if presentPackaging
requires-python = ">=3.9"is setConstraints
Output
Commit modernisation changes grouped by category (type hints, f-strings, pathlib, etc.) for easy review.
Generated by Developer Agent using Claude Code