Re: Re: Python-3-Migration of existing Data.fs

Arthur LEDARD <[email protected]> Tue, 20 Mar 2018 13:06:30 +0000
Newsgroups gmane.comp.web.zope.zodb
Message-ID <CAGngERgMWq6+zjZRa1JckWLyj0z1AsyDNYK5epXOJNR+OxMGwA@mail.gmail.com>
I understand that.

but an oid is bytes, and encoded this way.
U is for SHORT_BINSTRING in the pickle. It shouldn’t be read as unicode.

As there is zodbpickle, which I understand is here for compatibility, I
expect there won’t be problem from that.

We can put a solution in ZODB, zodbpickle, or report it to python.
I don’t know what is best.


Arthur

2018-03-20 12:33 GMT+00:00 Rodrigo Ferreira de Souza <[email protected]>:

> This bug should happen because in python3 all strings are unicode by
> default.
>
> Atenciosamente,
> Rodrigo Ferreira de Souza
>
> python -c "n='H+6(13+zT5((51(9z65zG+% 9';s=len(n)-1;i=list(range(s+
> 1))[::-1]+list(range(1,s+1));print('\n'.join([' '.join([chr(154-ord(n[(x
> if x > y else y)])) for y in i]) for x in i]))"
>
>
> On Tue, Mar 20, 2018 at 9:22 AM, Arthur LEDARD <[email protected]>
> wrote:
>
>> Hi,
>>
>> I’m trying to migrate my Data.fs.
>> I use your code, but I’m stuck with a non expected problem.
>>
>> Using python2, my oid are pickled in a format
>> "U\x08\x00\x00\x00\x00\x00\x00\x03\xeaq\x03"
>> The format seems correct, but is not understood with python3 :
>> UnicodeDecodeError.
>>
>> I was expecting to have problems with data, not oid. Did you face this
>> problem?
>> Did you succeed in your migrations?
>>
>> Regards,
>>
>> Arthur
>> Le lundi 23 mai 2016 16:48:18 UTC+1, mh a écrit :
>>>
>>> Hi,
>>>
>>> at "Berlin Strategic sprint 2016“ [1] Florian Pilz and me developed a
>>> tool to analyze a ZODB Filestorage for Python 2 string objects. When they
>>> are in an encoding besides ASCII this would prevent using this Filestorage
>>> with Python 3 because of decoding errors arising on loading the pickles.
>>> The tool is even able to convert those strings either to unicode by
>>> decoding them using a configurable encoding or convert them to
>>> `zodbpickle.binary` so Python 3 will read them as `bytes`.
>>> See [3] for the documentation of the tool and [2] for the repository on
>>> GitHub.
>>>
>>> * Is there already another tool for this analysis/migration?
>>> * Is there already any practical knowledge migrating Filestorage
>>> contents to Python 3?
>>> * Do you think such a tool is the right approach to achieve such a
>>> migration?
>>> * Is there anyone who wants to try out the tool on a Filestorage of a
>>> personal project and share the experiences? (I analyzed two projects where
>>> I have access to a Filestorage but I am sure this does not catch all the
>>> edge cases.)
>>>
>>>
>>>
>>> [1] http://gil.badall.net/2016/05/20/berlin-2016-sprint-update/
>>> [2] https://github.com/gocept/zodb.py3migrate
>>> [3] https://pythonhosted.org/zodb.py3migrate/
>>>
>>> --
>>> Michael Howitz · [email protected] · software developer
>>> gocept gmbh & co. kg · Forsterstraße 29 · 06112 Halle (Saale) · Germany
>>> <https://maps.google.com/?q=Forsterstra%C3%9Fe+29+%C2%B7+06112+Halle+(Saale)+%C2%B7+Germany&entry=gmail&source=g>
>>> http://gocept.com · Tel +49 345 1229889-8 <+49%20345%2012298898>
>>> Python, Pyramid, Plone, Zope · consulting, development, hosting,
>>> operations
>>>
>>> --
>> 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.
>>
>
>

-- 
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.