Fix regex pattern in version parsing and remove duplicate entry in __all__ #9978
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
This PR fixes two small bugs in the Celery codebase:
1. Bug Fix: Regex Pattern in Version Parsing
File:
celery/__init__.py(line 45)Issue: The regex pattern
r'(\d+)\.(\d+).(\d+)(.+)?'had an unescaped dot (.) between the minor and micro version numbers, which matches any character instead of a literal dot.Fix: Changed to
r'(\d+)\.(\d+)\.(\d+)(.+)?'to correctly match literal dots in version strings.Impact:
5.6X0b2would incorrectly match with old pattern)2. Code Quality: Remove Duplicate Entry
File:
celery/utils/__init__.py(line 25)Issue: Duplicate
'gen_task_name'entry in the__all__tuple.Fix: Removed the duplicate entry.
Impact: Cleaner code, no functional change.
Testing
Pre-PR Checklist
Note: These are simple bug fixes that don't require new unit tests as: