Bit Torrent T-0.3.13 (BitTornado) crashes when encountering Japanese character

Bug #183366 reported by sageb1
2
Affects Status Importance Assigned to Milestone
bittornado (Debian)
Fix Released
Unknown
bittornado (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Binary package hint: bittornado

BitTorrent T-0.3.13 (BitTornado)
OS: linux2
Python version: 2.4.3 (#2, Oct 6 2006, 07:52:30)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)]
wxWindows version: 2.6.1.2pre

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 2019, in onChooseFile
    if d2 == default:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa1 in position 0: ordinal not in range(128)

BitTornado and Bittorrent read .torrent file but does not see :pathl32: or :path.utf8: to choose which file information according to locale (utf32-like or utf8). instead, assumes utf8 western europe.

Revision history for this message
In , =?utf-8?q?Vincent_L=C3=B6nngren?= (bice77-malmo2) wrote : bittornado-gui: Similar error when attempting to download

Package: bittornado-gui
Version: 0.3.13-1
Followup-For: Bug #341276

I get a similar error, but it shows up as soon as I try to download the
file - I don't have to try to show file details or anything. The bytes
in posision 12-14 are, as far as I can tell, 'ä', 'r' and 'e'.

BitTorrent T-0.3.13 (BitTornado)
OS: linux2
Python version: 2.3.5 (#2, Aug 30 2005, 15:50:26)
[GCC 4.0.2 20050821 (prerelease) (Debian 4.0.1-6)]
wxWindows version: 2.6.1.2pre

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 2027, in onChooseFile
    self.onChooseFileDone(default, size)
  File "/usr/bin/btdownloadgui", line 2037, in onChooseFileDone
    self.fileNameText.SetLabel('%s' % (lname))
  File
"/usr/lib/python2.3/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line
10839, in SetLabel
    return _core_.Control_SetLabel(*args, **kwargs)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 12-14:
invalid data

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/dash
Kernel: Linux 2.6.12
Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)

Versions of packages bittornado-gui depends on:
ii bittornado 0.3.13-1 bittorrent client with enhanced cu
ii python 2.3.5-3 An interactive high-level object-o
ii python-wxgtk2.6 2.6.1.2 wxWidgets Cross-platform C++ GUI t

Versions of packages bittornado-gui recommends:
ii mime-support 3.35-1 MIME files 'mime.types' & 'mailcap

-- no debconf information

Revision history for this message
In , Micah Anderson (micah-debian) wrote : Re: Bug#341276: bittornado-gui: Similar error when attempting to download

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

severity 341276 wishlist
thanks

Bittornado has no encoding support at all, except for btmakemetafile.
There is no support on the client-side at all. I've altered the severity
of this bug to reflect this.

Micah

Vincent Lönngren wrote:
> Package: bittornado-gui
> Version: 0.3.13-1
> Followup-For: Bug #341276
>
> I get a similar error, but it shows up as soon as I try to download the
> file - I don't have to try to show file details or anything. The bytes
> in posision 12-14 are, as far as I can tell, 'ä', 'r' and 'e'.
>
> BitTorrent T-0.3.13 (BitTornado)
> OS: linux2
> Python version: 2.3.5 (#2, Aug 30 2005, 15:50:26)
> [GCC 4.0.2 20050821 (prerelease) (Debian 4.0.1-6)]
> wxWindows version: 2.6.1.2pre
>
> 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 2027, in onChooseFile
> self.onChooseFileDone(default, size)
> File "/usr/bin/btdownloadgui", line 2037, in onChooseFileDone
> self.fileNameText.SetLabel('%s' % (lname))
> File
> "/usr/lib/python2.3/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line
> 10839, in SetLabel
> return _core_.Control_SetLabel(*args, **kwargs)
> UnicodeDecodeError: 'utf8' codec can't decode bytes in position 12-14:
> invalid data
>
> -- System Information:
> Debian Release: testing/unstable
> APT prefers testing
> APT policy: (500, 'testing')
> Architecture: i386 (i686)
> Shell: /bin/sh linked to /bin/dash
> Kernel: Linux 2.6.12
> Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
>
> Versions of packages bittornado-gui depends on:
> ii bittornado 0.3.13-1 bittorrent client with enhanced cu
> ii python 2.3.5-3 An interactive high-level object-o
> ii python-wxgtk2.6 2.6.1.2 wxWidgets Cross-platform C++ GUI t
>
> Versions of packages bittornado-gui recommends:
> ii mime-support 3.35-1 MIME files 'mime.types' & 'mailcap
>
> -- no debconf information
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDz8Ho9n4qXRzy1ioRAsdUAJ4p89zNyOi7J0lP4r8+nUc8CZLGUgCgkS4+
gwrCvaRSzOCEg5WyCMyva4s=
=dhQs
-----END PGP SIGNATURE-----

Revision history for this message
In , Micah Anderson (micah-debian) wrote : merging 367111 330995 341276 350261

merge 367111 330995 341276 350261

Revision history for this message
In , Micah Anderson (micah-debian) wrote : unmerging 330995

# Automatically generated email from bts, devscripts version 2.9.19
unmerge 330995

Revision history for this message
In , Micah Anderson (micah-debian) wrote : merging 330955 367111 341276 350261

# Automatically generated email from bts, devscripts version 2.9.19
merge 330955 367111 341276 350261

Revision history for this message
In , Micah Anderson (micah-debian) wrote : severity of 367111 is wishlist

# Automatically generated email from bts, devscripts version 2.9.20
severity 367111 wishlist

Revision history for this message
In , Micah Anderson (micah-debian) wrote : merging 367111 330955

# Automatically generated email from bts, devscripts version 2.9.20
merge 367111 330955

Revision history for this message
In , Cameron Dale (camrdale) wrote : #377492: bittornado "'ascii' codec can't decode byte 0xc3"

reassign 377492 bittornado-gui
severity 377492 wishlist
merge 377492 330955

Revision history for this message
In , Jérémy Bobbio (jeremy-bobbio) wrote : Add patch tag

package bittornado-gui
tags 330955 + patch
thanks

--
Jérémy

Revision history for this message
In , Cameron Dale (camrdale) wrote : Re: Bug#330955: [PATCH] Fix unicode issue when making torrents

unmerge 330955
tags 330955 +pending
thanks

Thanks to Jeremy Bobbio for providing the patch to fix this one.

Cameron

Revision history for this message
In , Cameron Dale (camrdale) wrote : Re: Bug#401106: UnicodeDecodeError -message produce when invoking bittornado-gui

severity 401106 wishlist
merge 401106 341276
tags 401106 - patch
thanks

Looks like another Unicode problem to me, so I'm merging with the
others. Below is the (slightly) different error I get from the torrent
file.

Cameron

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 2066, in onNewpath
    self.fileDestText.SetLabel(path)
  File "/usr/lib/python2.3/site-packages/wx-2.6-gtk2-unicode/wx/_core.py",
line 11070, in SetLabel
    return _core_.Control_SetLabel(*args, **kwargs)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
59: ordinal not in range(128)

Revision history for this message
In , Cameron Dale (camrdale) wrote : Re: Bug#402394: bug on launching a torrent file by bittornado

reassign 402394 bittornado-gui
severity 402394 wishlist
merge 402394 341276
thanks

Revision history for this message
In , Cameron Dale (camrdale) wrote : Re: Processed (with 1 errors): Re: Bug#405082: bittornado-gui: Can reproduce bug *in Debian*

reassign 405082 bittornado-gui
merge 405082 341276
thanks

Revision history for this message
In , Cameron Dale (camrdale) wrote : Re: Bug#407275: Error running Bittornado T-0.3.15

reassign 407275 bittornado-gui
merge 407275 341276
thanks

Revision history for this message
In , Cameron Dale (camrdale) wrote : Re: Processed: This is not BitTorrent, it is BitTornado.

reassign 419995 bittornado-gui
severity 419995 wishlist
merge 350261 419995
thanks

Revision history for this message
In , Cameron Dale (camrdale) wrote : Re: Bug#429911: BitTornado bug

reassign 429911 bittornado-gui
severity 429911 wishlist
merge 429911 341276
thanks

Another encoding error.

Cameron

Revision history for this message
In , Samuel Ryden (trahojen) wrote : Suggested patch

I have included a patch that seems to cure the unicode issues I've
encountered so far. I am no python wizkid, but it seems to do the trick!

Regards,

- Sam

Revision history for this message
In , Samuel Ryden (trahojen) wrote :

Package: bittornado-gui

Upon opening a .torrent file that contain file names with funky
characters in it, causing a UnicodeDecodeError exception.
Error message and suggested patch below.

BitTorrent T-0.3.17 (BitTornado)
OS: linux2
Python version: 2.5.1 (r251:54863, May 2 2007, 16:56:35)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)]
wxWindows version: 2.6.3.2

Traceback (most recent call last):
  File "/usr/bin/btdownloadgui", line 2323, in _next
    savedas = dow.saveAs(choosefile, d.newpath)
  File "/var/lib/python-support/python2.5/BitTornado/download_bt1.py",
line 439, in saveAs
    n = path.join(n, i)
  File "posixpath.py", line 65, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 58:
ordinal not in range(128)

Suggested patch:
------
437a438,442
> import sys
> if sys.getdefaultencoding() == 'ascii':
> mustencode = True
> else:
> mustencode = False
438a444,445
> if mustencode:
> i = i.decode('ascii', 'replace')
------

Sorry for duplicate posts, I am still figuring this report system out.
I hope this is helpful to someone.

--
Best regards,

- Sam

Revision history for this message
In , Cameron Dale (camrdale) wrote : Re: Bug#441593: bittornado: UnicodeDecodeError

reassign 441593 bittornado-gui
severity 441593 wishlist
merge 441593 341276
thanks

On 9/10/07, peter <email address hidden> wrote:
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 15:
> ordinal not in range(128)

BitTornado has no support for encodings.

Thanks,
Cameron

Revision history for this message
In , Cameron Dale (camrdale) wrote : Re: Bug#445136: Package: Bittornado T

reassign 445136 bittornado-gui
severity 445136 wishlist
merge 445136 341276
thanks

On 10/3/07, Steve Meynell <email address hidden> wrote:
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 58:
> ordinal not in range(128)

BitTornado has no support for encodings at all, so adding support is a
wishlist item. You can also find this bug in Ubuntu here:

https://bugs.launchpad.net/ubuntu/+source/bittornado/+bug/87254

Thanks,
Cameron

Revision history for this message
In , Justin605 (justin605) wrote : Re: Bug#341276: Suggested patch

Package: bittornado-gui

BitTorrent T-0.3.17 (BitTornado)
OS: linux2
Python 2.4.4 (#2, Apr 5 2007, 20:11:18)

> Traceback (most recent call last):
> File "/usr/bin/btdownloadgui", line 2323, in _next
> savedas = dow.saveAs(choosefile, d.newpath)
> File "/var/lib/python-support/python2.5/BitTornado/download_bt1.py",
> line 439, in saveAs
> n = path.join(n, i)
> File "posixpath.py", line 65, in join
> path += '/' + b
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 58:
> ordinal not in range(128)
>
> Suggested patch:
> ------
> 437a438,442> import sys
> > if sys.getdefaultencoding() == 'ascii':
> > mustencode = True
> > else:
> > mustencode = False
> 438a444,445
> > if mustencode:
> > i = i.decode('ascii', 'replace')
>
> ------

Hi,

The above patch did not work for me when applied to /var/lib/python-
support/python2.4/BitTornado/download_bt1.py

So I created this fixed patch for /var/lib/python-support/python2.4/
BitTornado/download_bt1.py

376a377,382
> import sys
> if sys.getdefaultencoding() == 'ascii':
> mustencode = True
> else:
> mustencode = False
>
380,381c386,391
< if path.exists(path.join(loc, x['path'][0])):
< return True
---
> if mustencode:
> if path.exists(path.join(loc, x['path'][0].decode('ascii', 'replace'))):
> return True
> else:
> if path.exists(path.join(loc, x['path'][0])):
> return True
412a423,429
>
> import sys
> if sys.getdefaultencoding() == 'ascii':
> mustencode = True
> else:
> mustencode = False
>
419,420c436,441
< if path.exists(path.join(file, x['path']
[0])):
< existing = 1
---
> if mustencode:
> if path.exists(path.join(file, x['path'][0].decode('ascii', 'replace'))):
> existing = 1
> else:
> if path.exists(path.join(file, x['path'][0])):
> existing = 1
438a460,461
> if mustencode:
> i = i.decode('ascii', 'replace')

Go Linux,
-Justin Eraci

Revision history for this message
sageb1 (shkawamoto) wrote :

Binary package hint: bittornado

BitTorrent T-0.3.13 (BitTornado)
OS: linux2
Python version: 2.4.3 (#2, Oct 6 2006, 07:52:30)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)]
wxWindows version: 2.6.1.2pre

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 2019, in onChooseFile
    if d2 == default:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa1 in position 0: ordinal not in range(128)

BitTornado and Bittorrent read .torrent file but does not see :pathl32: or :path.utf8: to choose which file information according to locale (utf32-like or utf8). instead, assumes utf8 western europe.

Revision history for this message
Cameron Dale (camrdale) wrote :

BitTornado has no support for encodings at all.

Revision history for this message
sageb1 (shkawamoto) wrote :

I've gone upstream to bugs.debian.org to report this bug which isn't even in their bugs database.

Revision history for this message
Cameron Dale (camrdale) wrote : Re: [Bug 183366] Re: Bit Torrent T-0.3.13 (BitTornado) crashes when encountering Japanese character
Revision history for this message
In , Cameron Dale (camrdale) wrote : Re: Bug#463417: bittornado-gui: BITTORRENT ERROR Window pops-up at start

severity 463417 wishlist
merge 463417 341276
thanks

BitTornado has no support for encodings at all.

Cameron

Changed in bittornado:
status: Unknown → New
Daniel T Chen (crimsun)
Changed in bittornado:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
In , Cameron Dale (camrdale) wrote : Re: Processed (with 1 errors): Re: Bug#524811: bittornado: got crash report on asking for details of torrent

reassign 524811 bittornado-gui
merge 524811 341276
thanks

Changed in bittornado (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.