TypeError on all commands that get progress report from subprocess

Bug #872616 reported by IWATA Hidetaka
118
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
Undecided
Unassigned
QBzr
Fix Released
Critical
Martin Packman

Bug Description

In bzr2.5b2 (Installed by bzr2.5b2-1-setup.exe), qcommit does not work.

To reproduce:
  bzr init test
  echo foo>foo
  bzr add
  bzr qcommit -m test
  and clicking OK in the qcommit dialog

Then, it fails with following traceback.

--
Run command: bzr commit -m test foo
bzr: ERROR: exceptions.TypeError: unsupported type u'Collecting changes [0] - Stage'

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 923, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1128, in run_bzr
  File "bzrlib\commands.pyo", line 676, in run_argv_aliases
  File "bzrlib\commands.pyo", line 698, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\commands.py", line 821, in run
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\subprocess.py", line 888, in run_subprocess_command
  File "bzrlib\commands.pyo", line 1128, in run_bzr
  File "bzrlib\commands.pyo", line 676, in run_argv_aliases
  File "bzrlib\commands.pyo", line 698, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "bzrlib\builtins.pyo", line 3455, in run
  File "bzrlib\decorators.pyo", line 217, in write_locked
  File "bzrlib\workingtree_4.pyo", line 208, in commit
  File "bzrlib\decorators.pyo", line 217, in write_locked
  File "bzrlib\mutabletree.pyo", line 210, in commit
  File "bzrlib\commit.pyo", line 289, in commit
  File "bzrlib\cleanup.pyo", line 131, in run
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "bzrlib\commit.pyo", line 405, in _commit
  File "bzrlib\commit.pyo", line 959, in _set_progress_stage
  File "bzrlib\commit.pyo", line 972, in _emit_progress
  File "bzrlib\progress.pyo", line 123, in update
  File "bzrlib\ui\text.pyo", line 252, in _progress_updated
  File "bzrlib\ui\text.pyo", line 432, in show_progress
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\subprocess.py", line 804, in _repaint
  File "_bencode_pyx.pyx", line 399, in bzrlib._bencode_pyx.bencode (bzrlib\_bencode_pyx.c:4283)
  File "_bencode_pyx.pyx", line 383, in bzrlib._bencode_pyx.Encoder.process (bzrlib\_bencode_pyx.c:3939)
  File "_bencode_pyx.pyx", line 346, in bzrlib._bencode_pyx.Encoder._encode_list (bzrlib\_bencode_pyx.c:3464)
  File "_bencode_pyx.pyx", line 383, in bzrlib._bencode_pyx.Encoder.process (bzrlib\_bencode_pyx.c:3939)
  File "_bencode_pyx.pyx", line 346, in bzrlib._bencode_pyx.Encoder._encode_list (bzrlib\_bencode_pyx.c:3464)
  File "_bencode_pyx.pyx", line 391, in bzrlib._bencode_pyx.Encoder.process (bzrlib\_bencode_pyx.c:4055)
TypeError: unsupported type u'Collecting changes [0] - Stage'

bzr 2.5b2 on python 2.6.6 (Windows-7-6.1.7600)
arguments: ['C:\\Program Files\\Bazaar\\bzr.exe', 'qsubprocess', '--bencode',
    'l6:commit2:-m4:test3:fooe']
plugins: bzrtools[2.4.1], colo[0.3.1dev], explorer[1.2.1], launchpad[2.5b2],
    loom[2.2.1dev], pipeline[1.1.0], qbzr[0.21.1], rewrite[0.6.3dev],
    svn[1.1.0], xmloutput[0.8.7]
encoding: 'cp932', fsenc: 'mbcs', lang: 'ja'

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Tags: bencode

Related branches

Revision history for this message
IWATA Hidetaka (hid-iwata) wrote :

This maybe a problem of bzr itself comes from i18n support.
Primary reason is that bencode does not support unicode.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 872616] Re: qcommit does not work

IWATA Hidetaka пишет:
> This maybe a problem of bzr itself comes from i18n support.
> Primary reason is that bencode does not support unicode.

We have (had?) support in qbzr subprocess interface to properly encode
unicode to utf-8 when we need to pass tose strings over the pipe.
Maybe we just need check the usage of corresponding methods.

--
All the dude wanted was his rug back

Martin Packman (gz)
Changed in qbzr:
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Martin Packman (gz) wrote : Re: qcommit does not work

Looks like it's just the SubprocessProgressView class that needs adapting to the bzr changes.

Changed in qbzr:
assignee: nobody → Martin Packman (gz)
Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 872616] Re: qcommit does not work

Martin Packman пишет:
> Looks like it's just the SubprocessProgressView class that needs
> adapting to the bzr changes.

I think the right way is to encode unicode to unicode-escape encoding,
not utf-8, so we will pass ascii-only strings through the pipe.

--
All the dude wanted was his rug back

Revision history for this message
Martin Packman (gz) wrote : Re: qcommit does not work

This problem doesn't seem to require a fix on the bzrlib side.

Changed in qbzr:
status: Confirmed → In Progress
Changed in bzr:
status: New → Invalid
Martin Packman (gz)
summary: - qcommit does not work
+ TypeError on all commands that get progress report from subprocess
Martin Packman (gz)
Changed in qbzr:
status: In Progress → Fix Released
Revision history for this message
sugeng anto (anthos1984) wrote :

so this is the bug of qbzr? and I can use bzr by command line for merge / pull command?

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 872616] Re: TypeError on all commands that get progress report from subprocess

Am 05/12/11 15:55, schrieb sugeng anto:
> so this is the bug of qbzr? and I can use bzr by command line for merge
> / pull command?
Yes.

Newer versions of qbzr also have this bug fixed.

Cheers,

Jelmer

Revision history for this message
Martin Packman (gz) wrote :

Yes, you can use bzr on the command line to avoid this, or use either the stable 2.4 release or the latest beta which is 2.5b3 currently.

Changed in qbzr:
milestone: none → 0.22.0
tags: added: bencode
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.