Edit button does not work in non-ascii path name on Windows

Bug #401579 reported by Mitsuhiro Koga
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Explorer
Fix Released
Undecided
Unassigned

Bug Description

platform: Windwos XP
bzr: 1.16.1
bzr-explorer: rev 177

I selected the non-ascii file and pushed the edit button.
However, the editor is not started. And I've got error:

Traceback (most recent call last):
  File "C:/Documents and Settings/username/Application Data/bazaar/2.0/plugins\explorer\lib\wt_browser.py", line 124, in do_edit_file
    self._action_callback("edit", unicode(path))
  File "C:/Documents and Settings/username/Application Data/bazaar/2.0/plugins\explorer\lib\explorer.py", line 903, in _do_view_action
    self.edit_file(target)
  File "C:/Documents and Settings/username/Application Data/bazaar/2.0/plugins\explorer\lib\explorer.py", line 845, in edit_file
    self.run_app(self._editor.split() + [path])
  File "C:/Documents and Settings/username/Application Data/bazaar/2.0/plugins\explorer\lib\explorer.py", line 794, in run_app
    subprocess.Popen(args)
  File "subprocess.pyo", line 594, in __init__
  File "subprocess.pyo", line 822, in _execute_child
UnicodeEncodeError: 'ascii' codec can't encode characters in position 40-42: ordinal not in range(128)

Fortunately, I found the same bug as bzr.
see:
https://bugs.launchpad.net/bzr/+bug/382709

I tried the same correction, and the editor came to start.

Revision history for this message
Mitsuhiro Koga (shiena-jp) wrote :
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

Applied in rev 178 with a minor tweak: I convert the args before displaying them in diagnostic mode. Can you confirm that's ok please? (View/Diagnostic Mode then select file and hit Edit.)

Changed in bzr-explorer:
status: New → Fix Released
Revision history for this message
Mitsuhiro Koga (shiena-jp) wrote :

That's ok. Thank you.
But, I found other bug in diagnostic mode dialog.

I pushed the edit button at diagnostic mode with non-ascii branch.
The details message is garbled character.

Please replace os.getcwd() by os.getcwdu().

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

Sure. Do I need to update line 103 as well as line 793?

Revision history for this message
Mitsuhiro Koga (shiena-jp) wrote :

Sorry. Please update line 793.
Maybe, line 103 is no problem, because it is not displayed.

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

Ian, I think QT subprocess module should work much better here because it handles unicode well (AFAICT it does for QBzr well).

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 401579] Re: Edit button does not work in non-ascii path name on Windows

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

KOGA Mitsuhiro wrote:
> That's ok. Thank you.
> But, I found other bug in diagnostic mode dialog.
>
> I pushed the edit button at diagnostic mode with non-ascii branch.
> The details message is garbled character.
>
> Please replace os.getcwd() by os.getcwdu().
>
>
> ** Attachment added: "garbled_character_dialog.png"
> http://launchpadlibrarian.net/29270441/garbled_character_dialog.png
>

or bzrlib.osutils.getcwd()

John
=:->

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

iEYEARECAAYFAkpks1wACgkQJdeBCYSNAAOA1wCfbebdeEbkZ/xzftWHAMsipWH0
hIQAoLa3T1+U7fN1K9I7h1UwFmHRFBh+
=qDEj
-----END PGP SIGNATURE-----

Changed in bzr-explorer:
milestone: none → 0.5
Revision history for this message
Mitsuhiro Koga (shiena-jp) wrote :

Ian, sorry.
I made a mistake in the check on the info character of the diagnosis mode dialog.
Please convert the args after displaying them in diagnostic mode.
Because QMessageBox needs unicode.
And subprocess needs mbcs on windows.

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

Tweaked in rev 196.

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.