Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Invalid unicode in _pytest/terminal.py with Jython #5256
With: Jython 2.7.1 and pytest 4.5.0, I'm having the error below:
The error happens because
I'm not sure about the proper fix... in that function
If it's bytes, doing it an actual
The code doesn't really get to that point (the error is given on importing the module) and I wasn't really sure how to get to that point.
Anyways, great that you checked it... I'll try to change from unicode to bytes to see if that's enough.
I'm guessing your Jython version was compiled with "narrow unicode" support, which might be why it thinks it is an invalid unicode character.
What does this output for you?
>>> import sys >>> print sys.maxunicode
(Taken from this SO question)
I striked-out the comment above because this works on my system:
Anyway, can you try the snippet above?
Installed Jython myself, it is very odd what's happening here:
So it seems Jython cannot represent a lone surrogate like CPython can:
I think a solution then is to use
referenced this issue
May 15, 2019
Sorry about not answering sooner... I was actually thinking about this and I'm working in a similar issue in the pydev debugger -- linked above ;)
It seems that the pytest implementation only strips
I'm investigating the fix on the pydev debugger and will try to provide a fix for pytest once I'm done with that on the debugger side.