无法使用cfx run运行我开发的firefox附加组件

时间:2014-03-20 08:43:21

标签: python firefox firefox-addon firefox-addon-sdk

我正在尝试使用此tutorial开始开发Firefox插件,但会出现以下问题

(c:\addon-sdk-1.15) C:\Users\Khaled\my-addon>cfx run
Using binary at 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'.
Using profile at 'c:\users\khaled\appdata\local\temp\tmph_o0ca.mozrunner'.
Traceback (most recent call last):
  File "c:\addon-sdk-1.15\bin\cfx", line 33, in <module>
    cuddlefish.run()
  File "c:\addon-sdk-1.15\python-lib\cuddlefish\__init__.py", line 945, in run
    pkgdir=options.pkgdir)
  File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 705, in run_app

    runner.start()
  File "c:\addon-sdk-1.15\python-lib\mozrunner\__init__.py", line 532, in start
    self.process_handler = run_command(self.command+self.cmdargs, self.env, **se
lf.kp_kwargs)
  File "c:\addon-sdk-1.15\python-lib\mozrunner\__init__.py", line 59, in run_com
mand
    return killableprocess.Popen(cmd, env=env, **killable_kwargs)
  File "C:\Python27\lib\subprocess.py", line 709, in __init__
    errread, errwrite)
    TypeError: _execute_child() takes exactly 17 arguments (18 given)
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Python27\lib\atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 533, 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:\\users\\khaled\\appdata\\local\\temp\\harness-stdou
t-j8zqpd'
Error in sys.exitfunc:
Traceback (most recent call last):
  File "C:\Python27\lib\atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 533, 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:\\users\\khaled\\appdata\\local\\temp\\harness-stdou
t-j8zqpd'

我正在使用python 2.6.6并尝试2.7.6同样的问题出现......任何建议??

2 个答案:

答案 0 :(得分:1)

搜索之后我发现问题是:附加SDK与python 2.7.6不兼容,所以你必须使用python 2.6.6并在使用python 2.6.6时处理这个错误

(c:\addon-sdk-1.15) C:\Users\Khaled\my-addon>cfx run
Traceback (most recent call last):
  File "c:\addon-sdk-1.15\bin\cfx", line 33, in <module>
    cuddlefish.run()
  File "c:\addon-sdk-1.15\python-lib\cuddlefish\__init__.py", line 945, in run
    pkgdir=options.pkgdir)
  File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 639, 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 "C:\Python26\lib\atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 533, 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:\\users\\khaled\\appdata\\local\\temp\\harness-stdou
t-ecam39'
Error in sys.exitfunc:
Traceback (most recent call last):
  File "C:\Python26\lib\atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 533, 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:\\users\\khaled\\appdata\\local\\temp\\harness-stdou
t-ecam39' 

解决方案:

1-下载cp720

2-解压缩zip文件。

3-将文件cp720.py复制或移动到python编码文件夹中。

 Example: C:\Python26\Lib\encodings\

答案 1 :(得分:0)

你的Windows机器是说cfx run生成的文件正在被另一个进程使用,所以我猜你有一个病毒扫描程序或其他程序在创建后立即使用该文件