Repository navigation
Preserve URL marker characters in local filenames - #204
fabiocaccamo merged 4 commits into
Conversation
|
The Codacy report flags one assertion in tests/test_paths.py (line 44) under Bandit's "Avoid Use of Assert Statements" rule. These are pytest test assertions, following the existing test suite's style, rather than runtime validation in the library. Could this rule be excluded for tests/ in the Codacy configuration, or these test-only findings marked as false positives? I've left the assertions intact so pytest keeps its normal failure introspection. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #204 +/- ##
==========================================
- Coverage 98.59% 98.58% -0.01%
==========================================
Files 13 13
Lines 854 851 -3
==========================================
- Hits 842 839 -3
Misses 12 12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# Conflicts: # tests/test_paths.py
Describe your changes
Local filenames containing
#or?are parsed as URLs, which discards part of the name. For example, changing the extension ofReport#draft.txtproducesReport.pdfinstead ofReport#draft.pdf.Only split query/fragment components for URL inputs. Pass the original input through the filename helpers so URL syntax is handled before filesystem normalization. The regressions cover all five filename helpers and an actual temporary-file rename; HTTP, HTTPS, FTP and file URL controls retain query/fragment stripping.
Related issue
No matching issue or PR found; reproduction above. The older closed #161 addressed HTTP Content-Disposition headers, a separate filename path.
Validation
Checklist before requesting a review
AI-assisted with OpenAI Codex, including investigation, implementation and verification.