Bazaar > Explore > System Log doesnt work

Bug #391334 reported by Irongut
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar Explorer
Fix Released
Medium
Alexander Belchenko

Bug Description

Bazaar > Explore > System Log doesn't show any gui, on the console I get the error:

Traceback (most recent call last):
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 963, in do_bzr_system_log
    self.run_bzr_gui(".bzr.log")
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 751, in run_bzr_gui
    self.run_app(args)
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 742, in run_app
    subprocess.Popen(args)
  File "subprocess.pyo", line 594, in __init__
  File "subprocess.pyo", line 816, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified

Win2k, bzr 1.16, qbzr 0.11, explorer 0.3.1

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

From https://bugs.launchpad.net/bzr-explorer/+bug/391345/comments/5

"Bazaar > Explore > System Log runs my editor and attempts to open a non-existent file in the current branch. The file is called: Documents and SettingsirongutMy Documents.bzr.log

Looks like there are some path delimiters missing somewhere."

Um, yes, I saw this. It's a side effect of using shlex.split on Windows paths with backslashes. We need to fix it. And I think I know how.

Changed in bzr-explorer:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Alexander Belchenko (bialix) wrote :

fixed in trunk revno.115

Changed in bzr-explorer:
assignee: nobody → Alexander Belchenko (bialix)
milestone: none → 0.4
status: Confirmed → Fix Released
Revision history for this message
Alexander Belchenko (bialix) wrote :
Changed in bzr-explorer:
status: Fix Released → Confirmed
Revision history for this message
David Roberts (smartgpx) wrote :

Does the following observation help...

If I go to a console (Command Prompt) window and enter -

C:\<path_to>WORDPAD.EXE <path_to>.bzr.log

I get an error box from WordPad that says
"The document <path_to>BZR~1.LOG is in use by another application and cannot be accessed."

Might it be that underlying error that is being passed back to the BE app?

My hunch is that by default WordPad wants to open the file in RW mode, and that the process running BzrExplorer already has the file open in W mode, so the request fails? A quick web search has failed to find a ReadOnly command line switch for WordPad. Can we choose another file viewer for looking at the log file - bzr qviewer seems to work ok on .bzr.log when invoked from the command line.

Revision history for this message
David Roberts (smartgpx) wrote :

Purely for the purpose of checking this hypothesis, making the default editor NOTEPAD.EXE in lib\desktop_env.py solves the problem in hand. But this is NOT a recommended fix, since Notepad may not be an acceptable default editor for all other purposes. Opening the log with a Viewer rather than an Editor may be a safer option. I can't see how to configure in qviewer for this purpose.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 391334] Re: Bazaar > Explore > System Log doesnt work

David Roberts пишет:
> Does the following observation help...
>
> If I go to a console (Command Prompt) window and enter -
>
> C:\<path_to>WORDPAD.EXE <path_to>.bzr.log
>
> I get an error box from WordPad that says
> "The document <path_to>BZR~1.LOG is in use by another application and cannot be accessed."
>
> Might it be that underlying error that is being passed back to the BE
> app?

Maybe, but only if you're using wordpad as your default editor for bzr.
You can specify any other editor using bzr qconfig command (or in bzr-explorer run Settings ->
Configuration -> User Configuration).

But then problem occurs if your editor of choice has spaces in the path (so you need to quote the
path) and *all* backslashes in path sould be converted to slashes (e.g. instead of "C:\Program
Files\Notepad++\notepad++.exe" you have to use "C:/Program Files/Notepad++/notepad++.exe").

> My hunch is that by default WordPad wants to open the file in RW mode,
> and that the process running BzrExplorer already has the file open in W
> mode, so the request fails? A quick web search has failed to find a
> ReadOnly command line switch for WordPad. Can we choose another file
> viewer for looking at the log file - bzr qviewer seems to work ok on
> .bzr.log when invoked from the command line.

+1 for using qviewer for this. It helps avoiding many windows-specific problems with %(EDITOR)s.

Ian, do you agree for this change? E.g.:

=== modified file lib/app_suite.py
--- lib/app_suite.py 2009-08-19 05:43:44 +0000
+++ lib/app_suite.py 2009-08-23 18:14:49 +0000
@@ -164,7 +164,7 @@
     "plugins": "bzr qplugins",
     "version": "bzr qversion",
     "config:bazaar.conf": "bzr qconfig",
- ".bzr.log": '%(EDITOR)s "%(BZR_LOG)s"',
+ ".bzr.log": 'bzr qviewer "%(BZR_LOG)s"',
     }
 _QBZR_LOCAL_MAPPING = {
     "add": "bzr qadd --ui-mode %(selected)s",

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

David Roberts пишет:
> Purely for the purpose of checking this hypothesis, making the default
> editor NOTEPAD.EXE in lib\desktop_env.py solves the problem in hand. But
> this is NOT a recommended fix, since Notepad may not be an acceptable
> default editor for all other purposes. Opening the log with a Viewer
> rather than an Editor may be a safer option. I can't see how to
> configure in qviewer for this purpose.
>
To use qviewer there use my patch from previous mail.

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

Alexander Belchenko пишет:
> +1 for using qviewer for this. It helps avoiding many windows-specific
> problems with %(EDITOR)s.
>
> Ian, do you agree for this change?

Ian, I think we should change this before 0.7 release.

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

Fixed in rev 235.

Changed in bzr-explorer:
milestone: 0.4 → 0.7
status: Confirmed → Fix Released
Revision history for this message
Irongut (irongut) wrote :

I see this bug appearing again in 1.0.0rc2 running on bzr 2.1.0.

bzr: ERROR: No such file: u'C:UsersirongutDocuments.bzr.log'

The path delimiters are not being passed to qviewer. If I use All Commands to run qviewer with the correct path it works (bzr qviewer C:\Users\irongut\Documents\.bzr.log).

bzr log shows:

Fri 2010-02-26 20:33:24 +0000
0.047 bazaar version: 2.1.0
0.047 bzr arguments: [u'qviewer', u'C:UsersirongutDocuments.bzr.log']
0.062 looking for plugins in C:/Users/irongut/AppData/Roaming/bazaar/2.0/plugins
0.062 looking for plugins in C:/Program Files/Tools/Bazaar/plugins
0.203 encoding stdout as sys.stdout encoding 'cp850'
0.359 encoding stdout as sys.stdout encoding 'cp850'
0.422 None

341.362 return code 0

Fri 2010-02-26 20:40:11 +0000
0.063 bazaar version: 2.1.0
0.063 bzr arguments: [u'qrun', u'--ui-mode']
0.078 looking for plugins in C:/Users/irongut/AppData/Roaming/bazaar/2.0/plugins
0.078 looking for plugins in C:/Program Files/Tools/Bazaar/plugins
0.203 encoding stdout as sys.stdout encoding 'cp850'
33.234 encoding stdout as sys.stdout encoding 'cp850'

Fri 2010-02-26 20:40:44 +0000
0.063 bazaar version: 2.1.0
0.063 bzr arguments: [u'qsubprocess', u'--bencode', u'l7:qviewer35:C:\\Users\\irongut\\Documents\\.bzr.loge']
0.078 looking for plugins in C:/Users/irongut/AppData/Roaming/bazaar/2.0/plugins
0.078 looking for plugins in C:/Program Files/Tools/Bazaar/plugins
0.203 encoding stdout as osutils.get_user_encoding() 'cp1252'
0.328 bazaar version: 2.1.0
0.328 bzr arguments: [u'qviewer', u'C:\\Users\\irongut\\Documents\\.bzr.log']
0.328 encoding stdout as osutils.get_user_encoding() 'cp1252'
0.375 encoding stdout as osutils.get_user_encoding() 'cp1252'

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

Fixed in rev 466 of the 1.0 branch.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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