Zim

delete page in the contextual menu (right click) doesn't work

Bug #592828 reported by Raphaël Hertzog
This bug report is a duplicate of:  Bug #590736: [win32] Deleting directories fails. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zim
New
Undecided
Unassigned

Bug Description

When I right click on a page in the index and when I select "Supprimer la page" nothing happens. I'm using LANG="fr_FR.UTF-8". On the terminal and running with zim -D I see:
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.5/zim/gui/__init__.py", line 1041, in delete_page
    DeletePageDialog(self, path).run()
  File "/usr/lib/pymodules/python2.5/zim/gui/__init__.py", line 2296, in __init__
    'Remove links from %i pages linking to this page', i) % i
TypeError: not all arguments converted during string formatting

Strangely when I run it with LANG=C, then I get a confirmation prompt and when I confirm I get an error message "walk() got an unexpected keyword argument 'followlinks'" and I have to click a second time on "OK" but then it works.

In the terminal with zim -D I get this:
DEBUG: Action: delete_page
DEBUG: Pageindex has focus
DEBUG: Opening dialog "Delete Page - Zim"
DEBUG: Dialog response OK
DEBUG: Opening ProgressBarDialog
INFO: Remove file: /home/rhertzog/perso/notes/Notes/Test.txt
INFO: Remove file tree: /home/rhertzog/perso/notes/Notes/Test
DEBUG: Running ErrorDialog
ERROR: walk() got an unexpected keyword argument 'followlinks'
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.5/zim/gui/__init__.py", line 2317, in do_response_ok
    self.ui.notebook.delete_page(self.path, update_links, callback)
  File "/usr/lib/pymodules/python2.5/zim/notebook.py", line 1092, in delete_page
    store.delete_page(path)
  File "/usr/lib/pymodules/python2.5/zim/stores/files.py", line 134, in delete_page
    dir.remove_children()
  File "/usr/lib/pymodules/python2.5/zim/fs.py", line 633, in remove_children
    for root, dirs, files in os.walk(self.encodedpath, topdown=False, followlinks=False):
TypeError: walk() got an unexpected keyword argument 'followlinks'
DEBUG: Dialog response OK
DEBUG: Opening ProgressBarDialog
INFO: Open page: <FileStorePage: Notes:MindMapping> (<HistoryRecord: Notes:MindMapping>)
DEBUG: Closed dialog "Delete Page"

This is with zim 0.47-1 that I just uploaded to Debian and:
DEBUG: Gtk version is (2, 20, 1)
DEBUG: Pygtk version is (2, 17, 0)

Revision history for this message
Raphaël Hertzog (hertzog) wrote :

In case it was not clear, "Supprimer la page" is "Delete page" but in French.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

First issue is probably due to "%i" missing in the French translation string. You can check the translation here on launchpad.

Second issue is a double of bug #590736 (although now on linux with python 2.5)

Revision history for this message
Raphaël Hertzog (hertzog) wrote :

I fixed the translation on launchpad although technically it was better worded when you did not have to include %i which we know will result in 1 in this case and thus could be simplified.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

OK flagged this now as duplicate of bug #590736 for the second part of the issue.

Translation will be synced with next release. Technically it would be possible to make plural translations not take an argument for the first case, however this is more complex than it seems because the number of plurals is language specific, so would need to check if we are dealing with a western language first.

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.