Skip to content

bpo-41662: Fix bugs in binding parameters in sqlite3 #21998

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

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Aug 29, 2020

  • When the parameters argument is a list, correctly handle the case
    of changing it during iteration.
  • When the parameters argument is a custom sequence, no longer
    override an exception raised in __len__().

https://bugs.python.org/issue41662

* When the parameters argument is a list, correctly handle the case
  of changing it during iteration.
* When the parameters argument is a custom sequence, no longer
  override an exception raised in ``__len__()``.
Copy link
Member

@berkerpeksag berkerpeksag left a comment

Choose a reason for hiding this comment

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

Not sure how common is the second case, but I think it wouldn't hurt to have a test for the first case. Other than that, it looks good to me!

@@ -0,0 +1 @@
Fixed two rare bugs in binding parameters in the :mod:`sqlite3` module.
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately, this doesn't give readers any meaningful information so if you think it's not easy to explain what we are fixing here, I'd say it's OK to not add a NEWS entry.

Copy link
Member Author

Choose a reason for hiding this comment

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

Does it look better now? I added two separate entries for two bugs.

@serhiy-storchaka serhiy-storchaka merged commit 0b419b7 into python:master Sep 17, 2020
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the sqlite-bind-parameters branch September 17, 2020 07:35
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 17, 2020
* When the parameters argument is a list, correctly handle the case
  of changing it during iteration.
* When the parameters argument is a custom sequence, no longer
  override an exception raised in ``__len__()``.
(cherry picked from commit 0b419b7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Sep 17, 2020
@bedevere-bot
Copy link

GH-22289 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 17, 2020
* When the parameters argument is a list, correctly handle the case
  of changing it during iteration.
* When the parameters argument is a custom sequence, no longer
  override an exception raised in ``__len__()``.
(cherry picked from commit 0b419b7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

GH-22290 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Sep 17, 2020
* When the parameters argument is a list, correctly handle the case
  of changing it during iteration.
* When the parameters argument is a custom sequence, no longer
  override an exception raised in ``__len__()``.
(cherry picked from commit 0b419b7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
xzy3 pushed a commit to xzy3/cpython that referenced this pull request Oct 18, 2020
* When the parameters argument is a list, correctly handle the case
  of changing it during iteration.
* When the parameters argument is a custom sequence, no longer
  override an exception raised in ``__len__()``.
methane pushed a commit that referenced this pull request Oct 26, 2020
* When the parameters argument is a list, correctly handle the case
  of changing it during iteration.
* When the parameters argument is a custom sequence, no longer
  override an exception raised in ``__len__()``.
(cherry picked from commit 0b419b7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants