This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_pickle failing
Type: Stage:
Components: Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: vstinner Nosy List: tim.golden, vstinner
Priority: normal Keywords:

Created on 2010-04-13 13:04 by tim.golden, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg103045 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2010-04-13 13:04
test_pickle failing on WinXP

http://svn.python.org/projects/python/branches/py3k/Lib r80044

======================================================================
ERROR: test_unicode (__main__.CPicklerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "test\pickletester.py", line 523, in test_unicode
     p = self.dumps(u, proto)
   File "C:\work_in_progress\make-snapshots\branches\py3k\python\Lib\test\test_pickle.py", line 30, in dumps
     p.dump(arg)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udc80' in position 1: surrogates not allowed

======================================================================
ERROR: test_unicode (__main__.CDumpPickle_LoadPickle)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "test\pickletester.py", line 523, in test_unicode
     p = self.dumps(u, proto)
   File "C:\work_in_progress\make-snapshots\branches\py3k\python\Lib\test\test_pickle.py", line 30, in dumps
     p.dump(arg)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udc80' in position 1: surrogates not allowed

======================================================================
ERROR: test_unicode (__main__.DumpPickle_CLoadPickle)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "test\pickletester.py", line 524, in test_unicode
     u2 = self.loads(p)
   File "C:\work_in_progress\make-snapshots\branches\py3k\python\Lib\test\test_pickle.py", line 37, in loads
     return u.load()
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1-3: illegal encoding

----------------------------------------------------------------------
msg103047 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-13 13:28
The failing test was introduced by r80031 by me: see issue #8383.

I don't understand why the test fails.
msg103048 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-13 13:30
Does the follow code work on Windows?

>>> '\uDC80'.encode("utf8", "surrogatepass")
b'\xed\xb2\x80'
msg103049 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2010-04-13 13:37
Yes:

<dump>
C:\temp>\work_in_progress\make-snapshots\branches
Python 3.2a0 (py3k:80030, Apr 13 2010, 11:13:13)
Type "help", "copyright", "credits" or "license"
>>> '\uDC80'.encode("utf8", "surrogatepass")
b'\xed\xb2\x80'
>>>

</dump>
msg103050 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-13 13:44
How did you get these errors? I don't see them in the buildbots (x86 Windows7 3.x, x86 XP-4 3.x):
 * http://www.python.org/dev/buildbot/builders/x86 Windows7 3.x/builds/408/steps/test/logs/stdio
 * http://www.python.org/dev/buildbot/builders/x86 XP-4 3.x/builds/1874/steps/test/logs/stdio

Is it in your local computer? Did you recompiled Python?
msg103052 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2010-04-13 14:03
Well that's embarrassing: I updated but didn't rebuild. Sorry for the noise; all tests passing now. Please close the call.
msg103053 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-13 14:07
he he, ok, no problem.
History
Date User Action Args
2022-04-11 14:56:59adminsetgithub: 52633
2010-04-13 14:07:00vstinnersetstatus: open -> closed
resolution: not a bug
messages: + msg103053
2010-04-13 14:03:20tim.goldensetmessages: + msg103052
2010-04-13 13:44:49vstinnersetmessages: + msg103050
2010-04-13 13:37:48tim.goldensetmessages: + msg103049
2010-04-13 13:30:11vstinnersetmessages: + msg103048
2010-04-13 13:28:28vstinnersetmessages: + msg103047
2010-04-13 13:18:50amaury.forgeotdarcsetassignee: vstinner

nosy: + vstinner
2010-04-13 13:04:24tim.goldencreate