deprecate escape_string and unescape_string for icalendar 8#1308
Merged
niccokunzmann merged 2 commits intocollective:mainfrom Apr 4, 2026
Merged
deprecate escape_string and unescape_string for icalendar 8#1308niccokunzmann merged 2 commits intocollective:mainfrom
niccokunzmann merged 2 commits intocollective:mainfrom
Conversation
Rename escape_string -> _escape_string and unescape_string -> _unescape_string. Add deprecated wrappers that emit DeprecationWarning for external callers. Update all internal imports to use the private versions. Follows the same pattern used for escape_char/unescape_char. Partial fix for collective#1011
Documentation build overview
Show files changed (7 files in total): 📝 7 modified | ➕ 0 added | ➖ 0 deleted
|
niccokunzmann
approved these changes
Apr 4, 2026
Member
niccokunzmann
left a comment
There was a problem hiding this comment.
Thanks, this looks perfect!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renames
escape_stringandunescape_stringto private_escape_stringand_unescape_string, with deprecated public wrappers that emitDeprecationWarning.Why this matters
Per the maintainer's request in #1011, functions not in the public API (
icalendar.__all__) should be prefixed with_. External callers get a deprecation warning pointing them to contact maintainers before removal in icalendar 8.Changes
Follows the same pattern already established for
escape_char/unescape_char:src/icalendar/parser/string.py: Renamed implementations to_escape_stringand_unescape_string. Added deprecated wrappers. Updated__all__.src/icalendar/parser/content_line.py: Updated imports and call sites to use private versions.src/icalendar/parser/property.py: Updated import and call sites.src/icalendar/parser/__init__.py: Added private names to imports and__all__.CHANGES.rst: Added changelog entry under 7.0.4 Minor changes.Testing
escape_string/unescape_stringwill seeDeprecationWarningPartial fix for #1011
This contribution was developed with AI assistance (Claude Code).
📚 Documentation preview 📚: https://icalendar--1308.org.readthedocs.build/