Firefox Add-on SDK入门

时间:2021-05-26 19:34:37

I decided to learn to develop Firefox add-ons using the Add-on SDK and I was following the tutorial from the Mozilla website. When I got to the point of running cfx run I got the following exception (What the heck):

我决定学习使用Add-on SDK开发Firefox附加组件,我正在按照Mozilla网站上的教程进行操作。当我到达运行cfx run的时候,我得到了以下异常(哎呀):

NOTE: Firefox version 23.0, Add-on SDK 1.14, Python 2.6.6, OS Windows XP SP3

注意:Firefox版本23.0,附加SDK 1.14,Python 2.6.6,OS Windows XP SP3

(D:\addon-sdk-1.14) D:\my_addon>cfx run
Traceback (most recent call last):
  File "D:\addon-sdk-1.14\bin\cfx", line 33, in <module>
    cuddlefish.run()
  File "D:\addon-sdk-1.14\python-lib\cuddlefish\__init__.py", line 928, in run
    bundle_sdk=options.bundle_sdk)
  File "D:\addon-sdk-1.14\python-lib\cuddlefish\runner.py", line 640, in run_app

    print >>sys.stderr, "Using binary at '%s'." % runner.binary
LookupError: unknown encoding: cp720
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "D:\Python26\lib\atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "D:\addon-sdk-1.14\python-lib\cuddlefish\runner.py", line 534, in maybe_r
emove_outfile
    os.remove(outfile)
WindowsError: [Error 32] The process cannot access the file because it is being
used by another process: 'c:\\docume~1\\ab\\locals~1\\temp\\harness-stdout-p7spr
q'
Error in sys.exitfunc:
Traceback (most recent call last):
  File "D:\Python26\lib\atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "D:\addon-sdk-1.14\python-lib\cuddlefish\runner.py", line 534, in maybe_r
emove_outfile
    os.remove(outfile)
WindowsError: [Error 32] The process cannot access the file because it is being
used by another process: 'c:\\docume~1\\ab\\locals~1\\temp\\harness-stdout-p7spr
q'

2 个解决方案

#1


5  

It's a python (2.6) bug

这是一个python(2.6)错误

Try the proposed workaround or upgrade to 2.7

尝试建议的解决方法或升级到2.7

#2


1  

Just wanted to mention, using Python 2.7 might not work for some people. The Add-On SDK's README file states "Before proceeding, please make sure you've installed Python 2.5, 2.6, or 2.7", so I originally installed Python 2.7.6. (Note that this is with version 1.15 of the Add-On SDK.) Upon entering cfx run, I got a similar (though not identical) error message (which can be found in my bug report). After downgrading to Python 2.6.6, I no longer receive that error. Indeed, the Troubleshooting page for the Add-On SDK states that cfx currently expects Python 2.5 or 2.6. Older and newer versions may or may not work.

只是想提一下,使用Python 2.7可能对一些人不起作用。 Add-On SDK的README文件指出“在继续之前,请确保您已安装Python 2.5,2.6或2.7”,因此我最初安装了Python 2.7.6。 (请注意,这是附加SDK的1.15版本。)在进入cfx运行后,我得到了一个类似的(虽然不完全相同)错误消息(可以在我的错误报告中找到)。降级到Python 2.6.6后,我不再收到该错误。实际上,Add-On SDK的Troubleshooting页面指出cfx目前需要Python 2.5或2.6。较旧版本和较新版本可能有效,也可能无效。

#1


5  

It's a python (2.6) bug

这是一个python(2.6)错误

Try the proposed workaround or upgrade to 2.7

尝试建议的解决方法或升级到2.7

#2


1  

Just wanted to mention, using Python 2.7 might not work for some people. The Add-On SDK's README file states "Before proceeding, please make sure you've installed Python 2.5, 2.6, or 2.7", so I originally installed Python 2.7.6. (Note that this is with version 1.15 of the Add-On SDK.) Upon entering cfx run, I got a similar (though not identical) error message (which can be found in my bug report). After downgrading to Python 2.6.6, I no longer receive that error. Indeed, the Troubleshooting page for the Add-On SDK states that cfx currently expects Python 2.5 or 2.6. Older and newer versions may or may not work.

只是想提一下,使用Python 2.7可能对一些人不起作用。 Add-On SDK的README文件指出“在继续之前,请确保您已安装Python 2.5,2.6或2.7”,因此我最初安装了Python 2.7.6。 (请注意,这是附加SDK的1.15版本。)在进入cfx运行后,我得到了一个类似的(虽然不完全相同)错误消息(可以在我的错误报告中找到)。降级到Python 2.6.6后,我不再收到该错误。实际上,Add-On SDK的Troubleshooting页面指出cfx目前需要Python 2.5或2.6。较旧版本和较新版本可能有效,也可能无效。