New submission from RonnyPfannschmidt ronny.pfannschm...@gmx.de:
i passed in a unicode value as version by accident,
resulted in:
Traceback (most recent call last):
File /home/ronny/.local/venvs/clean/bin/pysetup, line 7, in module
execfile(__file__)
File /home/ronny/Projects/distutils2
RonnyPfannschmidt ronny.pfannschm...@gmx.de added the comment:
here the file that passed in the unicode string via hook
note that all of the passed characters are actually ascii
--
Added file: http://bugs.python.org/file21342/hgdistver.py
___
Python
Changes by RonnyPfannschmidt ronny.pfannschm...@gmx.de:
Added file: http://bugs.python.org/file21343/setup.cfg
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11638
RonnyPfannschmidt ronny.pfannschm...@gmx.de added the comment:
actually its enough to have the version_hook set the version to u'0.0'
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11638
Changes by RonnyPfannschmidt ronny.pfannschm...@gmx.de:
Added file: http://bugs.python.org/file21344/hgdistver.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11638
RonnyPfannschmidt ronny.pfannschm...@gmx.de added the comment:
i'll try to add some tests now
hopefully i can get rid of the implicit badness like trying to coerce
bytes to unicode in unpickle and storing bytes as list in pickle for
protocol 3
Changes by RonnyPfannschmidt ronny.pfannschm...@gmx.de:
--
title: byte/unicode pickle incompatibilities between python2 andand
python3 - byte/unicode pickle incompatibilities between python2 and python3
___
Python tracker rep
RonnyPfannschmidt ronny.pfannschm...@gmx.de added the comment:
its even worse
python3:
import pickle
pickle.dumps(b'', protocol=2)
b'\x80\x02c__builtin__\nbytes\nq\x00]q\x01\x85q\x02Rq\x03.'
python2.6:
import pickle
pickle.loads('\x80\x02c__builtin__\nbytes\nq\x00]q\x01\x85q\x02Rq\x03
RonnyPfannschmidt ronny.pfannschm...@gmx.de added the comment:
unpickle of any non-ascii string from python2 will break
the only way out would be to ensure text strings and a single defined
encoding (at that point storing unicode strings in any case seems more
practical)
also byte-strings
RonnyPfannschmidt ronny.pfannschm...@gmx.de added the comment:
in case the actual behavior is not supposed to change
how about a way to declare one wants exact 1:1 mapping between py2py3,
so strbytes and unicodestr will work for sure
something like load/dump(..., encoding=bytes) just crossed
New submission from RonnyPfannschmidt ronny.pfannschm...@gmx.de:
i just noticed that there are some slight differences of the
bytestring/unicodestring pickles between python2/3 using the protocols
0, 1 and 2
the first things i noticed are:
a str from python2 is unpickled as unicode in python3
Changes by RonnyPfannschmidt ronny.pfannschm...@gmx.de:
--
title: bytw/unicode string incompatibilities between python2 and and python3 -
byte/unicode pickle incompatibilities between python2 and and python3
___
Python tracker rep...@bugs.python.org
RonnyPfannschmidt ronny.pfannschm...@gmx.de added the comment:
the basic behavior i want to see for all protocols = 2
1. python 2 string maps to python3 byte-string
2. python 2 unicode maps to python3 string
3. python 3 string map to python 2 unicode
4. python 3 bytestring maps to python 2
RonnyPfannschmidt ronny.pfannschm...@gmx.de added the comment:
Since it breaks for anything non-ascii, its not that helpfull after all
and since python2 strings are encoding-unaware there is no way to fix
it.
It might be preferable to supply unpicklers that are cappable of
coercing if the user
14 matches
Mail list logo