0
我想按照這個博客文章無頭OAuth認證:Jython和httplib2的
http://blog.databigbang.com/automated-browserless-oauth-authentication-for-twitter/
基本上我;想要使用的Jython調用的HtmlUnit,打開網頁的授權,並接受它。然而,jython和httplib2之間存在一些不兼容性
File "/Users/andrey/jython2.7b1/Lib/site-packages/httplib2-0.8-py2.7.egg/httplib2/iri2uri.py", line 71, in iri2uri
authority = authority.encode('idna')
LookupError: unknown encoding 'idna'
如何解決此錯誤?如果我導入了encodings.idna,然後stringprep,re,那麼編解碼器也必須被導入,這是jython所沒有的。