Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError on html.py #193

Closed
nedbat opened this issue Aug 22, 2012 · 4 comments
Closed

UnicodeDecodeError on html.py #193

nedbat opened this issue Aug 22, 2012 · 4 comments
Labels
bug Something isn't working html

Comments

@nedbat
Copy link
Owner

nedbat commented Aug 22, 2012

Originally reported by Simon Coulton (Bitbucket: simoncoulton, GitHub: simoncoulton)


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()


@nedbat
Copy link
Owner Author

nedbat commented Aug 22, 2012

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?

@nedbat
Copy link
Owner Author

nedbat commented Oct 2, 2012

Original comment by Peter Portante (Bitbucket: portante, GitHub: 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.

@nedbat
Copy link
Owner Author

nedbat commented Oct 4, 2012

Fixed in <<changeset 16020b834643 (bb)>>, but the old status is discarded and the coverage report recreated from scratch.

@nedbat nedbat closed this as completed Oct 4, 2012
@nedbat
Copy link
Owner Author

nedbat commented Oct 4, 2012

Original comment by Simon Coulton (Bitbucket: simoncoulton, GitHub: simoncoulton)


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 :)

@nedbat nedbat added minor bug Something isn't working html labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working html
Projects
None yet
Development

No branches or pull requests

1 participant