Base65536 in Python?

i've just installed base65536 in python, found Here

As a test to see if it works, i've made this script here:

import base65536
a = base65536.encode("Hello World")
print a

i'm using python2.7. When i run it, i get this error:

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    a = base65536.encode("Hello World")
  File "C:\Python27\lib\site-packages\base65536\core.py", line 118, in encode
    stream.write(unichr(code_point))
ValueError: unichr() arg not in range(0x10000) (narrow Python build)

Any idea what to do here?

2

1 Answer

Python2 has two builds: one "narrow" and one "wide", depending on Unicode support. It looks like that library doesn't support the "narrow" build. You should install a "wide" build or hope the library gets updated. It looks like someone filed an issue on it:

Or you can use a recent version of Python3, which doesn't have this problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest