FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.15] gh-150449: Raise ValueError for sqlite3.Blob slices with a negative step by serhiy-storchaka · Pull Request #155773 · python/cpython · GitHub

Repository navigation

[3.15] gh-150449: Raise ValueError for sqlite3.Blob slices with a negative step - #155773

Open
serhiy-storchaka wants to merge 1 commit into
python:3.15from
serhiy-storchaka:backport-150450-3.15
Open

serhiy-storchaka wants to merge 1 commit into
python:3.15from
serhiy-storchaka:backport-150450-3.15

Conversation

serhiy-storchaka commented Aug 14, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Reading or writing a Blob slice with a negative step computed a negative length and failed with SystemError, which means an internal error.
It now raises ValueError.

Empty slices, which select nothing, are still allowed: blob[3:8:-1] returns b"" and assigning b"" to it is a no-op.

Support for negative steps is added in 3.16 by GH-150450.

…tive step

Reading or writing such a slice computed a negative length and failed with
SystemError.  Empty slices, which select nothing, are still allowed.

(cherry picked from commit d9e8d226a3d05ea020256086aee24d21f9792206)
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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL