Skip to content

Empty bytestrings are not longer returned on SQLite. #87534

Closed

Description

@felixxm
mannequin
BPO 43368
Nosy @berkerpeksag, @serhiy-storchaka, @erlend-aasland, @felixxm
PRs
  • bpo-43368: Fix fetching empty bytes on SQLite. #24706
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-03-03.14:16:41.453>
    created_at = <Date 2021-03-02.11:52:08.762>
    labels = ['type-bug', 'library', '3.10']
    title = 'Empty bytestrings are not longer returned on SQLite.'
    updated_at = <Date 2021-03-03.14:16:41.452>
    user = 'https://github.com/felixxm'

    bugs.python.org fields:

    activity = <Date 2021-03-03.14:16:41.452>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-03-03.14:16:41.453>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2021-03-02.11:52:08.762>
    creator = 'felixxm'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43368
    keywords = ['patch']
    message_count = 4.0
    messages = ['387918', '387921', '387924', '388021']
    nosy_count = 5.0
    nosy_names = ['ghaering', 'berker.peksag', 'serhiy.storchaka', 'erlendaasland', 'felixxm']
    pr_nums = ['24706']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue43368'
    versions = ['Python 3.10']

    Activity

    1. felixxm commented on Mar 2, 2021

      felixxmmannequin
      MannequinAuthor

      We noticed a regression in Python3.10.0a6 (it works properly in Python3.10.0a5) when running Django's test suite. Empty bytestrings are not longer returned properly on SQLite:

      def test_return_empty_bytes(self):
          cur = self.con.cursor()
          cur.execute("select X''")
          val = cur.fetchone()[0]
          self.assertEqual(val, b'')

      Regression in 47feb1f
      See https://bugs.python.org/issue43249

      I will submit PR in few minutes.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Mar 2, 2021
    3. erlend-aasland commented on Mar 2, 2021

      @erlend-aasland
      Contributor

      sqlite3_column_blob() should be handled like sqlite3_value_blob() in #68862:

      In case of NULL, check sqlite3_errcode() and raise MemoryError if needed. Else it's a zero-sized blob.

    4. erlend-aasland commented on Mar 2, 2021

      @erlend-aasland
      Contributor

      I created bpo-43369 for out-of-memory error handling, since it also applies to sqlite3_column_text().

    5. berkerpeksag commented on Mar 3, 2021

      @berkerpeksag
      Member

      New changeset 3b4b2cf by Mariusz Felisiak in branch 'master':
      bpo-43368: Fix fetching empty bytes in sqlite3 (GH-24706)
      3b4b2cf

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions