mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
e91dee87ed
commit
9ea9078ec7
3 changed files with 75 additions and 42 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue