Unknown encoding: idna ?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
GeminiServer Offline
Senior Member
Posts: 174
Joined: Oct 2003
Reputation: 0
Post: #1
hi python guys..

i need help with the following script! on the pc it works fine, but if i use the script on xbmc it won't work ? any idea?

here is the test script! workinf fine on pc!
Quote:import httplib, urllib, base64


ip = '192.168.0.110'
user = 'root'
password = 'blablabla'

def gethttprequest(request,portx, put01): #gethttprequest(requeststring, port':80', setuserpw 0:1 )
conn = httplib.httpconnection(ip+portx)
authhead = "basic %s " % base64.encodestring("%s:%s"%(user, password))

if put01 == '1':
conn.putrequest("get", request)
conn.putheader("authorization", authhead)
conn.endheaders()
else:
conn.request("get", request)
r = conn.getresponse()
print r.status, r.reason, r.msg
data = r.read()
conn.close()
return data

def test():
testx = gethttprequest('/version','','1')
print testx
test()

but on xbmc i get the following error!
Quote:31-07-2004 17:53:00 traceback (most recent call last):
31-07-2004 17:53:00 file "q:\scripts\dreambox-tv\get.py", line 27, in ?
31-07-2004 17:53:00
31-07-2004 17:53:00 test()
31-07-2004 17:53:00
31-07-2004 17:53:00 file "q:\scripts\dreambox-tv\get.py", line 25, in test
31-07-2004 17:53:00
31-07-2004 17:53:00 testx = gethttprequest('/version','','1')
31-07-2004 17:53:00 file "q:\scripts\dreambox-tv\get.py", line 13, in gethttprequest
31-07-2004 17:53:00
31-07-2004 17:53:00 conn.putrequest("get", request)
31-07-2004 17:53:00 file "q:\python\lib\httplib.py", line 667, in putrequest
31-07-2004 17:53:00
31-07-2004 17:53:00 self.putheader('host', self.host.encode("idna"))
31-07-2004 17:53:00 lookuperror
31-07-2004 17:53:00 :
31-07-2004 17:53:00 unknown encoding: idna
31-07-2004 17:53:00

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
atlascrushed Offline
Junior Member
Posts: 2
Joined: Aug 2004
Reputation: 0
Post: #2
hi, i came across your post from google, because i have a similar problem.

i've created a python script that uses httplib to screenscrape a page. it works from the script, but when i compile it using py2exe, it does not work, and i get a similar error:

traceback (most recent call last):
file "startup.pyc", line 456, in onconfigsubmit
file "httplib.pyc", line 718, in request
file "httplib.pyc", line 733, in _send_request
file "httplib.pyc", line 669, in putrequest
lookuperror: unknown encoding: idna


if i figure out a solution, i'll let you know.

-pat
find quote
atlascrushed Offline
Junior Member
Posts: 2
Joined: Aug 2004
Reputation: 0
Post: #3
ok, i figured out my problem. py2exe doesn't automatically bundled the characterset codecs, i have to add the option: "setup.py py2exe --packages encodings"

it appears that idna support was added in python 2.3, so perhaps your xmbc is an older version?

-pat
find quote
darkie Offline
Team-XBMC Developer
Posts: 529
Joined: Sep 2003
Reputation: 0
Post: #4
this is a known problem to me.
problem is that for idna encoding you need the unicode character set. this can be added to xbmc but it takes a lot of memory (that's why i left it away).
i'm still working on it so you can expect an update for it soon

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Alexpoet Offline
Skilled Python Coder
Posts: 172
Joined: Jun 2004
Reputation: 0
Location: Oklahoma City, OK
Post: #5
yay! darkie's back!

For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
find quote
darkie Offline
Team-XBMC Developer
Posts: 529
Joined: Sep 2003
Reputation: 0
Post: #6
should be fixed now in cvs

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
GeminiServer Offline
Senior Member
Posts: 174
Joined: Oct 2003
Reputation: 0
Post: #7
@darkie

same problem, is not fixed!

unicodedata.pyd is includet!

regards
geminiserver

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote