File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Original file line number Diff line number Diff line change @@ -198,8 +198,12 @@ class object, used to create cursors (keyword only)
198
198
db = proxy (self )
199
199
def _get_string_literal ():
200
200
# Note: string_literal() is called for bytes object on Python 3.
201
- def string_literal (obj , dummy = None ):
202
- return db .string_literal (obj )
201
+ if PY2 :
202
+ def string_literal (obj , dummy = None ):
203
+ return db .string_literal (obj )
204
+ else :
205
+ def string_literal (obj , dummy = None ):
206
+ return b'_binary' + db .string_literal (obj )
203
207
return string_literal
204
208
205
209
def _get_unicode_literal ():
@@ -235,6 +239,7 @@ def string_decoder(s):
235
239
self .converter [FIELD_TYPE .BLOB ].append ((None , string_decoder ))
236
240
237
241
self .encoders [bytes ] = string_literal
242
+ self .encoders [bytearray ] = string_literal
238
243
self .encoders [unicode ] = unicode_literal
239
244
self ._transactional = self .server_capabilities & CLIENT .TRANSACTIONS
240
245
if self ._transactional :
You can’t perform that action at this time.
0 commit comments