gh-92019: Make sqlite3.Blob indexing conform with the norm (#92020)

- get index now returns an int
- set index now requires an int in range(0, 256)

Resolves #92019
This commit is contained in:
Erlend Egeberg Aasland 2022-04-30 09:01:37 -06:00 committed by GitHub
parent e91dee87ed
commit 9ea9078ec7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 42 deletions

View file

@ -9,8 +9,8 @@ with con.blobopen("test", "blob_col", 1) as blob:
blob.write(b"hello, ")
blob.write(b"world.")
# Modify the first and last bytes of our blob
blob[0] = b"H"
blob[-1] = b"!"
blob[0] = ord("H")
blob[-1] = ord("!")
# Read the contents of our blob
with con.blobopen("test", "blob_col", 1) as blob: