Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 30, 2022

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Apr 28, 2022

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

Resolves #92019

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

ghost commented Apr 28, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Apr 28, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

FTR, I've changed the email address I'm using for CPython, from my work address to my private address.

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Apr 28, 2022

I'm not sure this needs a NEWS item; the blob interface has not been part of an official release yet.

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the quick change! I'll take a closer look soon. I don't think it needs a NEWS entry because the current behavior wasn't released in any alpha.

@JelleZijlstra
Copy link
Member

Also, something wrong on Windows:

FAIL: test_blob_set_item_negative_index (test.test_sqlite3.test_dbapi.BlobTests.test_blob_set_item_negative_index)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_sqlite3\test_dbapi.py", line 1210, in test_blob_set_item_negative_index
    self.assertEqual(self.blob[-1], 255)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 36281599 != 255

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Apr 28, 2022

Also, something wrong on Windows:

I'm on it 🕵🏻

UPDATE: fixed in 1badacb

@JelleZijlstra JelleZijlstra added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 29, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @JelleZijlstra for commit a713df6 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 29, 2022
@JelleZijlstra JelleZijlstra self-assigned this Apr 29, 2022
@erlend-aasland erlend-aasland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 29, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 6400ec5 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 29, 2022
@erlend-aasland erlend-aasland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 29, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit b0fc557 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 29, 2022
@JelleZijlstra
Copy link
Member

One buildbot failed on FAIL: test_finalize_structseq (test.test_embed.EmbeddingTests.test_finalize_structseq), I think that's a known spurious failure. A few others are still running.

@JelleZijlstra JelleZijlstra merged commit 9ea9078 into python:main Apr 30, 2022
JelleZijlstra added a commit to python/typeshed that referenced this pull request Apr 30, 2022
I just merged python/cpython#92020 which implemented this change (thanks @erlend-aasland!).
JelleZijlstra added a commit to python/typeshed that referenced this pull request Apr 30, 2022
@erlend-aasland erlend-aasland deleted the sqlite-blob-single-rw branch April 30, 2022 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sqlite3.Blob indexing is not conformant with existing norms
3 participants