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 302 forks source link

Errors trying to create language extension #514

Closed Mysterial closed 9 years ago

Mysterial commented 9 years ago

Komodo 9.2/Win7 x64

When I try to use the language extension template, after filling out the form I get these errors:

[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [koIFileEx.open]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://koextgen/content/koextgen_lib.js :: this.writeFile :: line 125" data: no] arg filename: "G:\Komodo\LScript"\chrome.manifest

[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [koIFileEx.open]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://koextgen/content/koextgen_lib.js :: this.writeFile :: line 125" data: no] arg filename: "G:\Komodo\LScript"\install.rdf

[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [koIFileEx.open]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://koextgen/content/koextgen_lib.js :: this.writeFile :: line 125" data: no] arg filename: G:\Komodo\LScript\udl\lscript-mainlex.udl

[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [koIFileEx.open]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://koextgen/content/koextgen_lib.js :: this.writeFile :: line 125" data: no] arg filename: G:\Komodo\LScript\components\koLScript_UDL_Language.py

I checked the directory where I put the project and there's only a ".komodotools" directory and the project file, it doesn't appear to have written the source files. I tried different paths as well as filling only the minimal amount in the form in case something I was adding was breaking it, but that didn't seem to help.

Mysterial commented 9 years ago

I confirmed that this works correctly on 9.1

Naatan commented 9 years ago

Cannot reproduce. Can you provide the exact steps, including what you filled out in the wizard?

Mysterial commented 9 years ago

I opened it via Project -> New From Template -> Create Komodo Language

To test, I left all the fields at default except for language name (LScript) and file extension (.ls)

Naatan commented 9 years ago

Are you certain you had write permissions to the location where you chose to save the files?

ervumlens commented 9 years ago

I think I'm seeing the same thing (KE 9.2.0, Vista 32 bit), using c:\projects\LScript as the project folder, then following Mysterial's steps by leaving the defaults except for language name and extension.

image

The path is writable and not special in any way. The LScript.komodoproject file, .komodotools folder, and the folder's contents are there, but nothing else (same as above).

Could the extraneous double quotes in the filenames be causing a problem? shrug

Here's the log:

[2015-08-12 19:10:24,767] [ERROR] URIlib: [Errno 22] invalid mode ('wb+') or filename: u'"C:\\projects\\LScript"\\chrome.manifest'
Traceback (most recent call last):
  File "C:\Program Files\ActiveState Komodo Edit 9.2\lib\mozilla\python\komodo\URIlib.py", line 628, in open
    self._file = open(self._path, self._mode)
IOError: [Errno 22] invalid mode ('wb+') or filename: u'"C:\\projects\\LScript"\\chrome.manifest'
ERROR:xpcom:Unhandled exception calling 'int8 * readfile(in dipper retval unicode &);'
Traceback (most recent call last):
  File "C:\Program Files\ActiveState Komodo Edit 9.2\lib\mozilla\python\xpcom\server\policy.py", line 300, in _CallMethod_
    return 0, func(*params)
  File "C:\Program Files\ActiveState Komodo Edit 9.2\lib\mozilla\components\koFileEx.py", line 125, in readfile
    return self.read(-1)
  File "C:\Program Files\ActiveState Komodo Edit 9.2\lib\mozilla\python\komodo\URIlib.py", line 827, in read
    bufptr = FileHandlerBase.read(self, nBytes)
  File "C:\Program Files\ActiveState Komodo Edit 9.2\lib\mozilla\python\komodo\URIlib.py", line 533, in read
    return self._file.read(nBytes)
AttributeError: 'NoneType' object has no attribute 'read'
[2015-08-12 19:14:54,230] [WARNING] koextgen: Unable to read file: chrome://koextgen/content/resources/komodolang/chrome.p.manifest
[2015-08-12 19:14:54,246] [ERROR] URIlib: [Errno 22] invalid mode ('wb+') or filename: u'"C:\\projects\\LScript"\\install.rdf'
Traceback (most recent call last):
  File "C:\Program Files\ActiveState Komodo Edit 9.2\lib\mozilla\python\komodo\URIlib.py", line 628, in open
    self._file = open(self._path, self._mode)
IOError: [Errno 22] invalid mode ('wb+') or filename: u'"C:\\projects\\LScript"\\install.rdf'
[2015-08-12 19:15:03,967] [ERROR] URIlib: [Errno 2] No such file or directory: u'C:\\projects\\LScript\\udl\\lscript-mainlex.udl'
Traceback (most recent call last):
  File "C:\Program Files\ActiveState Komodo Edit 9.2\lib\mozilla\python\komodo\URIlib.py", line 628, in open
    self._file = open(self._path, self._mode)
IOError: [Errno 2] No such file or directory: u'C:\\projects\\LScript\\udl\\lscript-mainlex.udl'
[2015-08-12 19:15:03,967] [WARNING] koextgen: Unable to read file: C:\projects\LScript\udl\lscript-mainlex.udl
[2015-08-12 19:15:03,967] [ERROR] URIlib: [Errno 2] No such file or directory: u'C:\\projects\\LScript\\components\\koLScript_UDL_Language.py'
Traceback (most recent call last):
  File "C:\Program Files\ActiveState Komodo Edit 9.2\lib\mozilla\python\komodo\URIlib.py", line 628, in open
    self._file = open(self._path, self._mode)
IOError: [Errno 2] No such file or directory: u'C:\\projects\\LScript\\components\\koLScript_UDL_Language.py'
[2015-08-12 19:15:03,967] [WARNING] koextgen: Unable to read file: C:\projects\LScript\components\koLScript_UDL_Language.py
[2015-08-12 19:15:03,967] [ERROR] URIlib: [Errno 2] No such file or directory: u'C:\\projects\\LScript\\udl\\lscript-mainlex.udl'
Traceback (most recent call last):
  File "C:\Program Files\ActiveState Komodo Edit 9.2\lib\mozilla\python\komodo\URIlib.py", line 628, in open
    self._file = open(self._path, self._mode)
IOError: [Errno 2] No such file or directory: u'C:\\projects\\LScript\\udl\\lscript-mainlex.udl'
[2015-08-12 19:15:08,226] [ERROR] URIlib: [Errno 2] No such file or directory: u'C:\\projects\\LScript\\components\\koLScript_UDL_Language.py'
Traceback (most recent call last):
  File "C:\Program Files\ActiveState Komodo Edit 9.2\lib\mozilla\python\komodo\URIlib.py", line 628, in open
    self._file = open(self._path, self._mode)
IOError: [Errno 2] No such file or directory: u'C:\\projects\\LScript\\components\\koLScript_UDL_Language.py'
ervumlens commented 9 years ago

I see the same errors after creating a regular extension, too. (KE 9.2.0, Vista 32bit)

Naatan commented 9 years ago

@mitchell-as could you please look into this for 9.2.1? I think it might be windows only.

@ervumlens - woah, vista? Living life on the edge huh :p

mitchell-as commented 9 years ago

@Naatan I confirm this is a bug and was introduced in 9.2. It works just fine in 9.1. I don't know what might have caused it though.

ervumlens commented 9 years ago

Floating quotes in the path produces the error.

I'll test this some more in Windows 6 once the hard drive light stops flashing for no reason.

ervumlens commented 9 years ago

Here's a macro that shows the problem a little clearer. First create a file named testfile.js in the project and save it with something in it, then run the macro.

//This is a javascript macro
var koext = ko.koextgen.extensionLib;
var filename = koext.getProjectPath('testfile.js');
alert("filename: " + filename);
alert("contents: " + koext.readFile(filename));

In Windows, In KE 9.1, the contents are displayed correctly. In 9.2, the contents fail to display.

Naatan commented 9 years ago

Awesome job tracking that down @ervumlens, that will make fixing this a ton easier.