commit/qcommit: non-ascii characters in --fixes XXX leads to traceback

Bug #463052 reported by marno
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Undecided
Unassigned
QBzr
Confirmed
Medium
Unassigned

Bug Description

Using german umlaut in description when checking in produces:

bzr: ERROR: exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128)

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 842, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1037, in run_bzr
  File "bzrlib\commands.pyo", line 654, in run_argv_aliases
  File "C:/Program Files (x86)/Bazaar/plugins\qbzr\lib\commands.py", line 776, in run
  File "bzrlib\commands.pyo", line 1037, in run_bzr
  File "bzrlib\commands.pyo", line 624, in run_argv_aliases
  File "bzrlib\commands.pyo", line 743, in parse_args
  File "optparse.pyo", line 1387, in parse_args
  File "optparse.pyo", line 1427, in _process_args
  File "optparse.pyo", line 1502, in _process_long_opt
  File "optparse.pyo", line 774, in process
  File "optparse.pyo", line 794, in take_action
  File "bzrlib\option.pyo", line 291, in _optparse_callback
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128)

bzr 2.0.1 on python 2.5.4 (Windows-Vista-6.0.6002-SP2)
arguments: ['C:\\Program Files (x86)\\Bazaar\\bzr.exe', 'qsubprocess', '"commit" "-m" "Textlogfile f\xfcr Buchungen speicherte im Webroot von xxxr.de" "apps/frontend/modules/buchen/actions/actions.class.php" "--fixes=Textlogfile" "--fixes=f\xfcr" "--fixes=Buchungen" "--fixes=speicherte" "--fixes=im" "--fixes=Webroot" "--fixes=von" "--fixes=xxx.de"']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Program Files (x86)\Bazaar\plugins\bzrtools [2.0.1]
  explorer C:\Program Files (x86)\Bazaar\plugins\explorer [0.8.3]
  launchpad C:\Program Files (x86)\Bazaar\plugins\launchpad [2.0.1]
  netrc_credential_store C:\Program Files (x86)\Bazaar\plugins\netrc_credential_store [2.0.1]
  qbzr C:\Program Files (x86)\Bazaar\plugins\qbzr [0.14.4]
  rebase C:\Program Files (x86)\Bazaar\plugins\rebase [0.5.4]
  svn C:\Program Files (x86)\Bazaar\plugins\svn [1.0.0]
  upload C:\Program Files (x86)\Bazaar\plugins\upload [1.0.0dev]
  xmloutput C:\Program Files (x86)\Bazaar\plugins\xmloutput [0.8.5]

*** 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: qcommit
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 463052] [NEW] German umlaut fails in checkin-description

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

marno wrote:
> Public bug reported:
>
> Using german umlaut in description when checking in produces:

...

> Traceback (most recent call last):
...

> File "bzrlib\option.pyo", line 291, in _optparse_callback
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128)
>
> bzr 2.0.1 on python 2.5.4 (Windows-Vista-6.0.6002-SP2)
> arguments: ['C:\\Program Files (x86)\\Bazaar\\bzr.exe', 'qsubprocess', '"commit" "-m" "Textlogfile f\xfcr Buchungen speicherte im Webroot von xxxr.de" "apps/frontend/modules/buchen/actions/actions.class.php" "--fixes=Textlogfile" "--fixes=f\xfcr" "--fixes=Buchungen" "--fixes=speicherte" "--fixes=im" "--fixes=Webroot" "--fixes=von" "--fixes=xxx.de"']
> encoding: 'cp1252', fsenc: 'mbcs', lang: None

  affects qbzr

Seems to be an issue with how qbzr is passing arguments to the bzr
subprocess, and then how bzr itself tries to parse those. I'm adding
qbzr, just in case there is something that it could be doing differently.

My initial guess is that it is an issue with how 'qsubprocess' is being
invoked. Because the '"commit..."' is being supplied as a single string
argument to the command.

Also, '"--fixes=f\xfcr"' is not usually how '--fixes' is used. Usually
you give it something like "--fixes lp:12345" or "--fixes gnome:2345".

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrqDT4ACgkQJdeBCYSNAAN9/wCdHiXag5l1A81ss3i/YpJDWD/7
5SUAn3UiNzY77r72SSd0c1rpLz3eudK4
=srnn
-----END PGP SIGNATURE-----

Revision history for this message
Alexander Belchenko (bialix) wrote :

I can imagine that somebody will setup bug tracker with non-ascii definitions and then perfectly valid command line like this:

bzr ci -m xxx --fixes баг:12345

will fails with the same traceback.

Changed in bzr:
status: New → Confirmed
Changed in qbzr:
status: New → Confirmed
importance: Undecided → Medium
tags: added: qcommit
summary: - German umlaut fails in checkin-description
+ commit/qcommit: non-ascii characters in --fixes XXX leads to traceback
Revision history for this message
Alexander Belchenko (bialix) wrote :
Download full text (3.7 KiB)

John A Meinel пишет:
> > marno wrote:
>> >> Public bug reported:
> >
>> >> Using german umlaut in description when checking in produces:
> >
> > ...
> >
>> >> Traceback (most recent call last):
> > ...
> >
>> >> File "bzrlib\option.pyo", line 291, in _optparse_callback
>> >> UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128)
> >
>> >> bzr 2.0.1 on python 2.5.4 (Windows-Vista-6.0.6002-SP2)
>> >> arguments: ['C:\\Program Files (x86)\\Bazaar\\bzr.exe', 'qsubprocess', '"commit" "-m" "Textlogfile f\xfcr Buchungen speicherte im Webroot von xxxr.de" "apps/frontend/modules/buchen/actions/actions.class.php" "--fixes=Textlogfile" "--fixes=f\xfcr" "--fixes=Buchungen" "--fixes=speicherte" "--fixes=im" "--fixes=Webroot" "--fixes=von" "--fixes=xxx.de"']
>> >> encoding: 'cp1252', fsenc: 'mbcs', lang: None
> >
> > affects qbzr
> >
> > Seems to be an issue with how qbzr is passing arguments to the bzr
> > subprocess, and then how bzr itself tries to parse those. I'm adding
> > qbzr, just in case there is something that it could be doing differently.

Well, I can reproduce it with plain command line like this

C:\Temp\2>bzr ci -m1 --fixes тест --unchanged

bzr: ERROR: exceptions.UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3:
ordinal not in range(128)

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 842, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1037, in run_bzr
  File "bzrlib\commands.pyo", line 624, in run_argv_aliases
  File "bzrlib\commands.pyo", line 743, in parse_args
  File "optparse.pyo", line 1387, in parse_args
  File "optparse.pyo", line 1427, in _process_args
  File "optparse.pyo", line 1502, in _process_long_opt
  File "optparse.pyo", line 774, in process
  File "optparse.pyo", line 794, in take_action
  File "bzrlib\option.pyo", line 291, in _optparse_callback
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

bzr 2.0.1 on python 2.5.4 (Windows-XP-5.1.2600-SP3)
arguments: ['C:\\Program Files\\Bazaar\\bzr.EXE', 'ci', '-m1', '--fixes', '\xf2\xe5\xf1\xf2',
'--unchanged']
encoding: 'cp1251', fsenc: 'mbcs', lang: 'ru'
plugins:
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [2.0.1]
  explorer C:\work\Bazaar\plugins\explorer [0.8.2]
  fastimport C:\work\Bazaar\plugins\fastimport [0.8.0dev]
  format1 C:\work\Bazaar\plugins\format1 [unknown]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [2.0.1]
  qbzr C:\work\Bazaar\plugins\qbzr [0.16.0dev]
  rebase C:\work\Bazaar\plugins\rebase [0.5.4]
  repoalias C:\work\Bazaar\plugins\repoalias [unknown]
  scmproj C:\work\Bazaar\plugins\scmproj [0.4.6dev]
  stats C:\work\Bazaar\plugins\stats [unknown]
  svn C:\work\Bazaar\plugins\svn [1.0.2dev]
  x_bit C:\work\Bazaar\plugins\x_bit [1.0.0]

*** 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...

Read more...

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.