the forums at degreez.net
http://forums.degreez.net/

Some unicode error...
http://forums.degreez.net/viewtopic.php?f=4&t=7110
Page 1 of 1

Author:  JCamus [ Tue Feb 27, 2007 11:11 am ]
Post subject:  Some unicode error...

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.

Author:  himaatin [ Tue Feb 27, 2007 5:00 pm ]
Post subject: 

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. :(

Author:  JCamus [ Wed Feb 28, 2007 10:11 am ]
Post subject: 

and is there a way to fix it?

Author:  huangwz [ Wed Mar 07, 2007 1:11 am ]
Post subject: 

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

Author:  seanodonnell [ Wed Aug 29, 2007 8:17 am ]
Post subject:  hit the same problem myself this morning and fixed it

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'))

Page 1 of 1 All times are UTC - 7 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/