Skip to content

Commit f4e17dd

Browse files
committed
Fix custom codec example to not use the obsolete "binary" parameter
1 parent 4b3f993 commit f4e17dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/usage.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ JSON values using the :mod:`json <python:json>` module.
181181
182182
try:
183183
def _encoder(value):
184-
return json.dumps(value).encode('utf-8')
184+
return json.dumps(value)
185185
186186
def _decoder(value):
187-
return json.loads(value.decode('utf-8'))
187+
return json.loads(value)
188188
189189
await conn.set_type_codec(
190190
'json', encoder=_encoder, decoder=_decoder,
191-
schema='pg_catalog', binary=True
191+
schema='pg_catalog'
192192
)
193193
194194
data = {'foo': 'bar', 'spam': 1}

0 commit comments

Comments
 (0)