MonetDB / pymonetdb

The Python API for MonetDB
https://www.monetdb.org/
Mozilla Public License 2.0
28 stars 20 forks source link

Perform bin<->hex conversion directly, not in pymonetdb.Binary #100

Closed joerivanruth closed 2 years ago

joerivanruth commented 2 years ago

When encoding, encode bytes values as BLOB 'hexbytes', not just 'hexbytes'. When decoding, call fromhex directly instead of going through pymonetdb.Binary.

pymonetdb.Binary() tried to hexdecode its argument, this has now been removed. If I understand PEP249 correctly, pymonetdb.Binary is intended for application code to portably mark data as Binary. This was necessary in Python 2 where strings and byte arrays shared the same underlying type.

For example, SQLAlchemy calls pymonetdb.Binary() on bytes objects, with the old implementation this used to crash.