Lib.test.print_sans_lib.py Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jython Show documentation
Show all versions of jython Show documentation
Jython is an implementation of the high-level, dynamic, object-oriented
language Python written in 100% Pure Java, and seamlessly integrated with
the Java platform. It thus allows you to run Python on any Java platform.
# Used by test_codec_jy::CodecsTestCase.test_print_sans_lib.
# Run without importing site module so codec registry is not initialised yet.
import sys
from os.path import basename
# Hide standard library from import mechanism so the Python codec cannot be found.
sys.path = [p for p in sys.path if basename(p).lower() != 'lib']
# Can we still encode and decode utf-8?
encoded = u'hi'.encode("utf-8")
encoded.decode('utf-8')