Komodo / KomodoEdit

Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
http://www.komodoide.com/komodo-edit
Other
2.15k stars 300 forks source link

Error when pasting a file into Places #532

Open ervumlens opened 9 years ago

ervumlens commented 9 years ago

KE 9.2.0 Linux

Problem I'm trying to copy a file from the file manager (the Linux-equivalent of Windows' explorer.exe). I ctrl+c the file and ctrl+v over Places. I get the error dialog below.

These are local files.

This occurs when copying either a file or a folder, just one or more than one, into the project root or into a project subfolder. Same result with two different file managers (PCManFM and Thunar).

error copying file to ke

Log!

ERROR:xpcom:Unhandled exception calling 'int8 * treeOperationWouldConflict_MultipleSrc(in Array[], in uint32, in wstring, in boolean, out uint32, out Array[], out Array[], out Array[]);'
Traceback (most recent call last):
  File "/home/ervumlens/Komodo-Edit-9/lib/mozilla/python/xpcom/server/policy.py", line 300, in _CallMethod_
    return 0, func(*params)
  File "/home/ervumlens/Komodo-Edit-9/lib/mozilla/distribution/bundles/places@activestate.com/components/koPlaceTreeView.py", line 1027, in treeOperationWouldConflict_MultipleSrc
    if self._targetIsParent(srcURI, targetURI):
  File "/home/ervumlens/Komodo-Edit-9/lib/mozilla/distribution/bundles/places@activestate.com/components/koPlaceTreeView.py", line 1007, in _targetIsParent
    srcURIParent = self._getURIParent(srcURI)
  File "/home/ervumlens/Komodo-Edit-9/lib/mozilla/distribution/bundles/places@activestate.com/components/koPlaceTreeView.py", line 1068, in _getURIParent
    return uri[:uri.rindex("/")]
ValueError: substring not found
ervumlens commented 9 years ago

FYI, this is similar to (but not the same as) bug 103604. There is no mention of errors there, only the lack of copying.

ervumlens commented 9 years ago

I get junk in the data that's read from the clipboard, for example when logging in places.js.

Copy a file in file manager, then run this macro (based on the places.js code).

//this is a javascript macro
var srcURIs = null;
var srcType = null;
var flavor = 'text/uri-list'
if (xtk.clipboard.containsFlavors([flavor])) {
    srcType = flavor;
    srcURIs = xtk.clipboard.getTextFlavor(flavor);
} else {
    srcType = "(unknown)";
    srcURIs = xtk.clipboard.getText();
}

alert("Via xtk.clipboard: " + srcType + ": " + srcURIs);

In Windows, the code fails. In Linux, I get this:

screenshot - 08152015 - 07 38 40 pm

Not quite a text/uri-list output. I see the same thing when logging the data. This might explain why searching for "/" in the string produces a substring not found error.

th3coop commented 8 years ago

Did this work in other version? I think this is an enhancement.