the forums at degreez.net

It is currently Thu Mar 28, 2024 2:12 am

All times are UTC - 7 hours [ DST ]




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Some unicode error...
PostPosted: Tue Feb 27, 2007 11:11 am 
Offline

Joined: Tue Feb 27, 2007 10:58 am
Posts: 2
well, hello, i looked for unicode problems but there are only some with chinese torrents and shit. the torrent that gives me the error has spanish accents like in "teléfono".

it goes like this:

Code:
BitTorrent T-0.3.18 (BitTornado)
OS: linux2
Python version: 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)]
wxWindows version: 2.6.3.2

Traceback (most recent call last):
  File "/usr/bin/btdownloadgui", line 476, in onInvoke
    apply(event.func, event.args, event.kwargs)
  File "/usr/bin/btdownloadgui", line 2018, in onChooseFile
    if d2 == default:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)


so, what about it? in a normal situation i'd change the client, but the tracker has banned them all except for Azureus, Bittornado and uTorrent. Well, Azureus does not run because of resource consumption (hungry b!tch) and there is no uTorrent for linux. Only one i've got left: Bittornado, i like it, it's light and simple.

So say, what about this unicode error?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 27, 2007 5:00 pm 
Offline

Joined: Tue Feb 13, 2007 3:35 am
Posts: 8
I think uTorrent runs under wine.
But wine is probably even bigger than using Azureus.


Personally I often get this Unicode errors with Koren or Japanese files. :(


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 28, 2007 10:11 am 
Offline

Joined: Tue Feb 27, 2007 10:58 am
Posts: 2
and is there a way to fix it?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 07, 2007 1:11 am 
Offline

Joined: Wed Mar 07, 2007 12:53 am
Posts: 3
I found that from dialogbox we get the string like u'\uxxxx\uxxxx"
but from others we get the string like '\Xxx\Xxx"
so we need encode unicode to string


a=u'\u767e\u5bb6\u8bb2\u575b\u4e4b\u5343\u53e4\u4e00\u79cd'
b='\xb0\xd9\xbc\xd2\xbd\xb2\xcc\xb3\xd6\xae\xc7\xa7\xb9\xc5\xd2\xbb\xd6\xd6' #gbk

c=a+b #error

c=a.encode('cp936')+b #OK


Top
 Profile  
 
PostPosted: Wed Aug 29, 2007 8:17 am 
Offline

Joined: Wed Aug 29, 2007 8:11 am
Posts: 1
The problem seems to be with calls to path.join mixing asi and unicode strings.

I went in and fixed it, on ubuntu feisty there is a file called

/var/lib/python-support/python2.5/BitTornado/download_bt1.py

edit it and change the following 3 lines (make sure you do not delete the whitespace at the beginning of the lines, this is python and its actually important.). Standard disclaimer applies, if you bork your install of bittornado doing this its not my fault!

line 419

was:

if path.exists(path.join(file, x['path'][0])):

change to:

if path.exists(path.join(file, unicode(x['path'][0], 'utf-8'))):

line 422

was:

file = path.join(file, self.info['name'])

change to

file = path.join(file, unicode(self.info['name'],'utf-8'))

line 439:

was:

n = path.join(n, i,)

change to:

n = path.join(n, unicode(i,'utf-8'))


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group