Repository navigation
fix(storage3): replace print() with warnings.warn() for trailing slash notice - #1380
Merged
Merged
Conversation
…h notice The storage3 module used print() to notify about missing trailing slashes in the endpoint URL. This is problematic because print() pollutes stdout, cannot be suppressed by consumers, and provides no stack trace context. Replace with warnings.warn() using UserWarning category and stacklevel=2 so the warning points to the caller rather than the internal __init__. This follows Python best practices and gives consumers control via warnings.filterwarnings(). Fixes supabase#1379 Co-Authored-By: Claude Opus 4.6 <[email protected]>
📝 WalkthroughWalkthroughReplaces Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
o-santi
approved these changes
Feb 9, 2026
Pull Request Test Coverage Report for Build 21763714864Details
💛 - Coveralls |
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.
Fixes #1379
Problem
The
storage3module uses bareprint()to emit a notice when the storage endpoint URL lacks a trailing slash:While PR #1367 (v2.27.3) fixed the SDK side by ensuring the URL always ends with
/, theprint()call remains problematic for direct consumers ofstorage3:warnings.warn(), consumers have no way to filter or silence itSolution
Replace
print()withwarnings.warn()using:UserWarningcategory (standard for usage notices)stacklevel=2so the warning points to the caller, not the internal__init__This follows Python best practices and gives consumers control via
warnings.filterwarnings().Changes
src/storage/src/storage3/_sync/bucket.py—import warnings, replaceprint()withwarnings.warn()src/storage/src/storage3/_async/bucket.py— same change (async variant)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes