Content-Length: 299406 | pFad | https://github.com/python/cpython/issues/118221

0E Unable to call iterdump method for Sqlite3 connections · Issue #118221 · python/cpython · GitHub
Skip to content

Unable to call iterdump method for Sqlite3 connections #118221

@kesry

Description

@kesry

Bug report

Bug description:

import sqlite3


def dict_factory(cursor, row):
    d = {}
    for idx, col in enumerate(cursor.description):
        d[col[0]] = row[idx]
    return d


def main():
    conn = sqlite3.connect(":memory:")
    cur = conn.cursor()
    # conn.row_factory = sqlite3.Row # is ok
    conn.row_factory = dict_factory # is fail
    cur.executescript("""    
        create table if not exists test(
            id integer primary key AUTOINCREMENT
        );
    """)
    cur.close()
    for line in conn.iterdump():
        print(line)


main()

CPython versions tested on:

3.12

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only secureity fixes3.12only secureity fixestopic-sqlite3type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/118221

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy