UnicodeDecodeError problem when run BitTorrent module

=?gb2312?q?=B7=C5=DC=F8=20=CC=B8?= jolley84 at yahoo.com.cn
Mon Oct 9 14:52:58 CEST 2006


hello guys, i have a problem that when i compile one of bittornado source file named:btdownloadgui.py and i get such a error message: 
    Code: [Download]    
     
   BitTorrent T-0.3.15 (BitTornado)   
   OS: win32   
   Python version: 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)]   
   wxWindows version: 2.6.3.3   
     
   Traceback (most recent call last):   
     File "C:\BitTornado-0.3.15\BitTornado-CVS\btdownloadgui.py", line 2334, in _next   
       savedas = dow.saveAs(choosefile, d.newpath)   
     File "C:\BitTornado-0.3.15\BitTornado-CVS\BitTornado\download_bt1.py", line 409, in saveAs   
       if path.exists(path.join(file, x['path'][0])):   
     File "C:\Python24\lib\ntpath.py", line 102, in join   
       path += "\\" + b   
   UnicodeDecodeError: 'ascii' codec can't decode byte 0xb9 in position 1: ordinal not in range(128)   
     
   


of those errors: one is from bittornado source file btdownloadgui.py itself,and one is from the the bittornado library,also one is from the python library. weird,isn't it? 
later i get something more about bittorrent encodings and decodings,utf-8,utf-16,ascii,latin.etc.and i try almost all of these decodings and encodings,such as use decode('utf-8'),or encode('utf-16')etc.and those doings donot come out effectively. 
later i use 
    Code: [Download]    
     
   try:   
       from sys import getfilesystemencoding   
       ENCODING = getfilesystemencoding()   
   except:   
       from sys import getdefaultencoding   
       ENCODING = getdefaultencoding()   
     
   


in the btdowngui.py source file,however the bug remains. 
does it means the bittornado library or the python library itself is misleading? 
so help. 
thanks if anyone can be useful. 
regards, 
jolley


 		
---------------------------------
 Mp3·è¿ñËÑ-иèÈȸè¸ßËÙÏ   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-bugs-list/attachments/20061009/c2e73c71/attachment.htm 


More information about the Python-bugs-list mailing list