Re: Py2 - Py3 Migration

Tres Seaver <[email protected]>
Newsgroups gmane.comp.web.zope.zodb
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/15/2016 08:40 AM, Jim Fulton wrote:

> IMO, before such a conversion, I would introduce a Python 2 bytes
> type (a simple subclass of string) and then I'd go through a database
> and convert everything that should be bytes to bytes.  Doing this
> would likely require application knowledge.  I'd then have the
> conversion script convert all bytes to bytes and all other ordinary
> strings to unicode.

'zodbpickle.binary' is exactly that class:  under Python2, it subclasses
'bytes', while under Python3, it is just an alias for 'bytes'.  If the
application uses the type for values which are really supposed to be
bytes, then they will unpickle cleanly as bytes in Python3.


Tres.
- -- 
===================================================================
Tres Seaver          +1 540-429-0999          [email protected]
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJXEQ9mAAoJEPKpaDSJE9HYqX8P/RYmqjfnugx43qyeosHMNAXn
J3XZqqYOweVuPkVAotZ2IrtYxbrboedEzt2JP2TWJ//lSbKZ8gs/Go+Ms9H8is+W
K1x/YfpjgJcDj4Kh+vx7mvQBasepjL6zZVh0130Hgu6oOyeJXlGF26WVVF9rIMZ1
eqTrNV4yAX3PzQK0Q1ENU/3w4beyK1gqJSEFVQjVo7Sm1lBQgobNvtiuNcggMHnx
RnSN/upkyJJD63bMZzL850ZJBwX7y9zhsP6+9XV5QpWW1NHS+EUMLY7vklAu2+XA
En3OcGicgn8kB9kI7ea9tBz5vsfToeUMqMI0p3C+bkzp5GR8S9ajAWbwNY1lHsCx
9JFOcYBChgPYahHoBqY2OFT7B3iHTZcBfKxrFddM93ytrDBhKDAj+2M/0tu1xSTS
0obtaw1Mo9uZ1dp2abSxpVuR5RDRPp0Q5ZHDPWjm+zZDQ5NXkfSmOfG9fBRzMJWj
AVpcgcBQ1+Elvn7wWzcdeyhWsKFsCiMA2xElUVfBQX0fGa8uDPqSckeak3vAqe4m
GSP8z5wHDkV4QzprG0N0DHKW1BbdRBfypnRlbX90wiudRLWGDUu3HOwmlm9eoqT1
BQj//JvKXssPa3uxGLk2jOz9Mw0G/2DVJf7UPGv2p7uw5sXcMqI6ja+Xtii7gjx9
wbWFLl5ojoFwfNC34Xpo
=7ShR
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.