Message401356
I modified your second example slightly:
```
import sqlite3
conn = sqlite3.connect(":memory:")
conn.text_factory=bytes
conn.row_factory = sqlite3.Row
cursor = conn.execute("CREATE TABLE foo (bar)")
numbers = range(4)
cursor.executemany("INSERT INTO foo (bar) VALUES (?)", ((str(v),) for v in numbers))
cursor.execute("SELECT bar FROM foo")
print("first fetch")
for row in cursor.fetchmany(2):
print(type(row[0]))
conn.__init__(":memory:")
conn.execute("CREATE TABLE foo (bar)")
letters = "a", "b", "c", "d"
conn.executemany("INSERT INTO foo (bar) VALUES (?)", ((v,) for v in letters))
# Currently this uses the old database, old row_factory, but new text_factory"
print("second fetch")
for row in cursor.fetchall():
print(type(row[0]))
```
Here's the output:
first fetch
<class 'bytes'>
<class 'bytes'>
second fetch
<class 'str'>
<class 'str'> |
|
Date |
User |
Action |
Args |
2021-09-08 08:29:45 | erlendaasland | set | recipients:
+ erlendaasland, petr.viktorin |
2021-09-08 08:29:45 | erlendaasland | set | messageid: <1631089785.77.0.463794086086.issue45126@roundup.psfhosted.org> |
2021-09-08 08:29:45 | erlendaasland | link | issue45126 messages |
2021-09-08 08:29:45 | erlendaasland | create | |
|