UnicodeDecodeError on html.py

Issue #193 resolved
Simon Coulton created an issue

Using Python 3.2.3, the app occasionally fails to build the HTML required, and errors on line 277: status = pickle.load(fstatus). This could just be that the original status.dat file had some Python 2 code in it, in any case the following resolves the issue:

try: if sys.version_info < (3, 0): status = pickle.load(fstatus) else: u = pickle._Unpickler(fstatus) u.encoding = 'latin1' status = u.load()

Comments (5)

  1. Ned Batchelder repo owner

    Could you send or attach a data file that has this problem? Also, can you explain more about how Python 2 and Python 3 are mixing in your environment?

  2. Peter Portante

    Hi Ned, I seem to be encountering the same problem from pycscope.

    I am using Fedora 16, where by default /usr/bin/python is a link to python2. I run the runtests script which just invokes nosetests like:

    nosetests --with-coverage --cover-package pycscope -cover-erase --cover-html $@

    When I then switch the default python by relinking /usr/bin/python to python3 I get the decode error.

    If I remove the "cover" directory then python 3 coverage works.

    For now I have specified a separate directory for my python2 and python2 coverage runs.

  3. Simon Coulton reporter

    Hi Ned, Sorry for not getting back sooner, didn't see the emails come in. Using virtualenv with 3.2, the nose.cfg used was: [nosetests] cover-erase=1 with-coverage=1 cover-package=watson cover-html=1 cover-html-dir=docs/tests/html with-xunit=1 xunit-file=docs/tests/nosetests.xml nocapture=1

    Thanks for the fix :)

  4. Log in to comment