tkFileBrowser icon indicating copy to clipboard operation
tkFileBrowser copied to clipboard

TclError: Item already exists

Open lepmik opened this issue 3 years ago • 1 comments

Hi, I'm unable to get this to work, is it a bug in tkFileBrowser?

from tkfilebrowser import askopendirname
askopendirname(initialdir='/')
---------------------------------------------------------------------------
TclError                                  Traceback (most recent call last)
/tmp/ipykernel_533702/3888443447.py in <module>
      1 from tkfilebrowser import askopendirname
----> 2 askopendirname(initialdir='/')

~/.virtualenvs/expipe/lib/python3.8/site-packages/tkfilebrowser/functions.py in askopendirname(parent, title, **kwargs)
     59             enable the user to create new folders if True (default)
     60     """
---> 61     dialog = FileBrowser(parent, mode="opendir", multiple_selection=False,
     62                          title=title, **kwargs)
     63     dialog.wait_window(dialog)

~/.virtualenvs/expipe/lib/python3.8/site-packages/tkfilebrowser/filebrowser.py in __init__(self, parent, initialdir, initialfile, mode, multiple_selection, defaultext, title, filetypes, okbuttontext, cancelbuttontext, foldercreation, **kw)
    394             else:
    395                 txt = l[1]
--> 396             self.left_tree.insert("", "end", iid=l[0],
    397                                   text=txt,
    398                                   image=self.im_folder)

/usr/lib/python3.8/tkinter/ttk.py in insert(self, parent, index, iid, **kw)
   1359         opts = _format_optdict(kw)
   1360         if iid is not None:
-> 1361             res = self.tk.call(self._w, "insert", parent, index,
   1362                 "-id", iid, *opts)
   1363         else:

TclError: Item /mnt already exists

lepmik avatar Sep 20 '21 09:09 lepmik

I am having the same issue for the past few weeks. I'm not a programmer but I suspect the solution may be related to this: https://github.com/hwstar/BOMtools/issues/2

esalkin1 avatar Aug 24 '22 18:08 esalkin1