firecat53 / keepmenu

Dmenu/Rofi frontend for Keepass databases
GNU General Public License v3.0
204 stars 32 forks source link

Crash when trying to move a group into itself #127

Open vaygr opened 2 years ago

vaygr commented 2 years ago

I guess it should be hidden (along with children?) to prevent mishandling.

Otherwise this:

Process DmenuRunner-2:
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/keepmenu/__main__.py", line 171, in main
    manager = client()
  File "/usr/lib/python3.10/site-packages/keepmenu/__main__.py", line 76, in client
    mgr.connect()
  File "/usr/lib/python3.10/multiprocessing/managers.py", line 531, in connect
    conn = Client(self._address, authkey=self._authkey)
  File "/usr/lib/python3.10/multiprocessing/connection.py", line 507, in Client
    c = SocketClient(address)
  File "/usr/lib/python3.10/multiprocessing/connection.py", line 635, in SocketClient
    s.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/site-packages/keepmenu/keepmenu.py", line 305, in run
    self.dmenu_run()
  File "/usr/lib/python3.10/site-packages/keepmenu/keepmenu.py", line 378, in dmenu_run
    func()
  File "/usr/lib/python3.10/site-packages/keepmenu/keepmenu.py", line 447, in menu_manage_groups
    group = manage_groups(self.database.kpo)
  File "/usr/lib/python3.10/site-packages/keepmenu/edit.py", line 450, in manage_groups
    group = move_group(kpo)
  File "/usr/lib/python3.10/site-packages/keepmenu/edit.py", line 510, in move_group
    group = kpo.move_group(group, destgroup)
  File "/usr/lib/python3.10/site-packages/pykeepass/pykeepass.py", line 482, in move_group
    destination_group.append(group)
  File "/usr/lib/python3.10/site-packages/pykeepass/group.py", line 94, in append
    self._element.append(entries._element)
  File "src/lxml/etree.pyx", line 842, in lxml.etree._Element.append
  File "src/lxml/apihelpers.pxi", line 1342, in lxml.etree._appendChild
ValueError: cannot append parent to itself
firecat53 commented 1 year ago

Yep, can reproduce and we should fix!