Settings menu items don't work

Bug #391345 reported by Irongut
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Explorer
Fix Released
Medium
Alexander Belchenko

Bug Description

In the Settings menu only the Configuration (qconfig) menu item works. The other menu items all fail with very similar traceback messages about missing files. I have conf and ignore files in my \Application Data\bazaar\2.0 directory and some branch specific ignores.

Could be related to another bug I posted: 391334 - Bazaar > Explore > System Log doesnt work

Settings > Ignores:
Traceback (most recent call last):
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 1050, in do_set_ignores
    self.edit_config_file("ignore")
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 772, in edit_config_file
    self.edit_file(path)
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 778, in edit_file
    self.run_app(self._editor.split() + [path])
  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

Settings > Rules:
Traceback (most recent call last):
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer.py", line 1053, in do_set_rules
    self.edit_config_file("rules")
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer.py", line 772, in edit_config_file
    self.edit_file(path)
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer.py", line 778, in edit_file
    self.run_app(self._editor.split() + [path])
  File "F:/Program Files/Programming Tools/Bazaar/plugins\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

Settings > Locations:
Traceback (most recent call last):
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 1056, in do_set_projects
    self.edit_config_file("locations.conf")
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 772, in edit_config_file
    self.edit_file(path)
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 778, in edit_file
    self.run_app(self._editor.split() + [path])
  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

Settings > Credentials:
Traceback (most recent call last):
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 1059, in do_set_credentials
    self.edit_config_file("authentication.conf")
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 772, in edit_config_file
    self.edit_file(path)
  File "F:/Program Files/Programming Tools/Bazaar/plugins\explorer\lib\explorer.py", line 778, in edit_file
    self.run_app(self._editor.split() + [path])
  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 :

This error occurs because bzre tries to invoke subprocess.Popen for 'wordpad' as editor. subprocess.Popen requires full path to application.

In the same situation bzrlib/msgeditor.py uses subprocess.call function. I think we need to use call() in bzre too.

As short-term workaround you need to specify full path to the editor in your bazaar.conf (use qconfig dialog to edit it).

Changed in bzr-explorer:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

subprocess.call blocks so I don't think we want that. I'll update desktop_env.py to use the full path name to wordpad.exe.

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

To get the full path to wordpad.exe one need to use get_app_path() function from bzrlib.win32utils.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 391345] Re: Settings menu items don't work

Alexander Belchenko пишет:
> To get the full path to wordpad.exe one need to use get_app_path()
> function from bzrlib.win32utils.

Actually this function has problems to read REG_EXPAND_SZ string (for
wordpad.exe) from registry.

Things become more tricky...

Revision history for this message
Irongut (irongut) wrote :

I've configured an external editor (Notepad++) as suggested and the settings commands now work for me.

This doesn't fix Bug #391334 tho. Now 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.

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

Alexander Belchenko пишет:
> Alexander Belchenko пишет:
>> To get the full path to wordpad.exe one need to use get_app_path()
>> function from bzrlib.win32utils.
>
> Actually this function has problems to read REG_EXPAND_SZ string (for
> wordpad.exe) from registry.
>
> Things become more tricky...

OK, I've sent the patch for bzr. Once it will be merged to trunk we can
properly fix this problem in Bazaar Explorer itself.

I don't think reimplementing get_app_path() from bzrlib makes any sense,
because there is known workaround.

Changed in bzr-explorer:
assignee: nobody → Alexander Belchenko (bialix)
status: Confirmed → Triaged
Revision history for this message
Alexander Belchenko (bialix) wrote :

Okay, I've made required changes in Bazaar Explorer and in bzr itself (these changes will be released as bzr 1.17).

Changed in bzr-explorer:
milestone: none → 0.4
status: Triaged → Fix Committed
Changed in bzr-explorer:
status: Fix Committed → 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.