Closed
Bug 958609
Opened 11 years ago
Closed 11 years ago
Add-on SDK 1.15 incompatible with Python 2.7.6
Categories
(Add-on SDK Graveyard :: General, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: danielcharles1988, Assigned: xefbfbd)
References
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release)
Build ID: 20130910160258
Steps to reproduce:
Following the instructions in the "Installation Guide" (https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Installation), I installed the Add-On SDK 1.15 on my machine (with Windows 7 Enterprise, Service Pack 1; my version of Firefox is 24.0, if that helps). I downloaded the ZIP file and extracted it to the folder C:\Tools\addon-sdk-1.15. The README file states "please make sure you've installed Python 2.5, 2.6, or 2.7", so I installed Python 2.7.6 (which is the latest version of Python 2) to the folder C:\Python27 (which I added to my PATH variable). After activating the Add-On SDK (using "bin\activate"), I followed the instructions on the "Getting Started With cfx" page (https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Getting_Started_With_cfx): I used the "cd" command to move to the directory of my plugin, entered "cfx init" on the command line, copied the given code into "main.js", and entered the command "cfx run" on the command line. This produced an error, which does not occur when Python 2.6.6 was installed.
Actual results:
Here is the command that I entered and the resulting output:
(C:\Tools\addon-sdk-1.15) C:\Tools\addon-sdk-1.15\my-addon>cfx run
Using binary at 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'.
Using profile at 'c:\users\dcharles\appdata\local\temp\tmpqzkxlm.mozrunner'.
Traceback (most recent call last):
File "C:\Tools\addon-sdk-1.15\bin\cfx", line 33, in <module>
cuddlefish.run()
File "C:\Tools\addon-sdk-1.15\python-lib\cuddlefish\__init__.py", line 945, in
run
pkgdir=options.pkgdir)
File "C:\Tools\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 705, in r
un_app
runner.start()
File "C:\Tools\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:\Tools\addon-sdk-1.15\python-lib\mozrunner\__init__.py", line 59, in r
un_command
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:\Tools\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 533, in m
aybe_remove_outfile
os.remove(outfile)
WindowsError: [Error 32] The process cannot access the file because it is being
used by another process: 'c:\\users\\dcharles\\appdata\\local\\temp\\harness-std
out-ynxnsc'
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:\Tools\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 533, in m
aybe_remove_outfile
os.remove(outfile)
WindowsError: [Error 32] The process cannot access the file because it is being
used by another process: 'c:\\users\\dcharles\\appdata\\local\\temp\\harness-std
out-ynxnsc'
Expected results:
After uninstalling Python 2.7.6 (and removing the C:\Python27 folder from my PATH variable) and installing Python 2.6.6 (to the folder C:\Python26, which I added to my PATH variable), everything works as expected. The following output is shown on the command line:
(C:\Tools\addon-sdk-1.15) C:\Tools\addon-sdk-1.15\my-addon>cfx run
Using binary at 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'.
Using profile at 'c:\users\dcharles\appdata\local\temp\tmpdsmtwi.mozrunner'.
...and a Firefox window is opened.
I propose that the README should be modified to be consistent with the Troubleshooting page (https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Troubleshooting), which states that "cfx currently expects Python 2.5 or 2.6. Older and newer versions may or may not work."
Comment 1•11 years ago
|
||
this seems to be a problem specifically with Python 2.7.6, on windows.
> TypeError: _execute_child() takes exactly 17 arguments (18 given)
this cpython change looks like the cause: http://hg.python.org/cpython/rev/43749cb6bdbd#l1.14
someone from the Python project thought it wise to change the definition of a method by adding a non-optional argument *in the middle of the argument list*. i understand it's an internal method, but still, makes it hard to write code that would work across versions..
Status: UNCONFIRMED → NEW
Component: Documentation → General
Ever confirmed: true
OS: All → Windows 7
Summary: README incorrect? Add-on SDK seems to be incompatible with Python 2.7 → Add-on SDK 1.15 incompatible with Python 2.7.6
Reporter | ||
Comment 2•11 years ago
|
||
Looks like that's probably the issue. Perhaps in the README file (https://github.com/mozilla/addon-sdk/blob/master/README), after line 9, someone could add "Python 2.7.6 is also not supported in Windows," and then link to this bug. I would attempt to make that change myself on Github, but I'm not sure how to; I'm not familiar with Github.
Zombie, would you like to add this note to the readme?
Assignee: nobody → tomica+amo
Priority: -- → P2
Comment 5•11 years ago
|
||
Commits pushed to master at https://github.com/mozilla/addon-sdk
https://github.com/mozilla/addon-sdk/commit/8c607fe0269565873829f66d6b2457f9fd9654bd
bug 958609 - add note about Python 2.7.6 to README
and update documentation links to MDN
https://github.com/mozilla/addon-sdk/commit/d87f1cde89e75bc5ae743ead6a3db6c2cd2427f7
bug 958609 - don't imply future fixes
https://github.com/mozilla/addon-sdk/commit/63e254476526f1a2bdf1ac2c1dfe0fb76a00b290
Merge pull request #1352 from zombie/958609-python-276
bug 958609 - add note about Python 2.7.6 to README
Updated•11 years ago
|
Attachment #8361295 -
Flags: review?(wbamberg) → review+
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
I have encountered the same bug with Add-on SDK 1.14/1.15 and CPython 2.7.6 on windows.
Google and stackoverflow lead me to bug 950894 and bug 958609
We can make use of *args(arbitrary argument list), and unpack the tuple args later depending on the value of sys.hexversion:
in addon-sdk\python-lib\mozrunner\killableprocess.py, line 109
def _execute_child(self, *args_tuple):
# workaround for Bug 958609
if sys.hexversion < 0x02070600: # prior to 2.7.6
(......) = args_tuple
else: # 2.7.6 and later
(..., to_close, ...) = args_tuple
works fine with Add-on SDK 1.15 and CPython 2.6.6/2.7.4/2.7.5/2.7.6 on windows
Comment 8•11 years ago
|
||
Given that we are planning a 1.16 release now and we have what looks like a simple patch for this issue I think we should consider taking the fix
Comment 9•11 years ago
|
||
Given that this is mozrunner code (that few on the SDK team understand) I think we should just watch bug 950894 and take whatever lands there into our fork.
Depends on: 950894
Comment 10•11 years ago
|
||
(In reply to uFFFD from comment #7)
> workaround for cpython 2.7.6 on windows
hey, thanks for your work!
i have assigned this bug to you so you can take over. also note, the Addon SDK works with GitHub Pull Requests, so if you are familiar with that workflow, it might be better to submit PR at https://github.com/mozilla/addon-sdk/ once they review/land your code in mozrunner.
Assignee: tomica+amo → xefbfbd
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Priority: -- → P2
Resolution: --- → FIXED
Updated•11 years ago
|
Status: RESOLVED → REOPENED
Priority: P2 → --
Resolution: FIXED → ---
Priority: -- → P1
Assignee | ||
Comment 11•11 years ago
|
||
Attachment #8370256 -
Flags: review?(wbamberg)
Comment 12•11 years ago
|
||
Commits pushed to master at https://github.com/mozilla/addon-sdk
https://github.com/mozilla/addon-sdk/commit/c3a46fd6f6b57b87b6c8cb4601ff116d5b5b6b53
Bug 958609 - Add-on SDK incompatible with Python 2.7.6 on windows
https://github.com/mozilla/addon-sdk/commit/e40633f73b3a0a366a954ad7a876b8308ff79c91
Merge pull request #1379 from uFFFD/958609
Bug 958609 - Add-on SDK incompatible with Python 2.7.6 on windows (Uplift of mozrunner bug 950894)
Comment 13•11 years ago
|
||
Comment on attachment 8370256 [details]
Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1379
No need for a review here as this is just uplifting the fix into our fork. Thanks!
Attachment #8370256 -
Flags: review?(wbamberg)
Updated•11 years ago
|
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Comment 14•11 years ago
|
||
not simply reverting because of the updated docs URLs..
Attachment #8381009 -
Flags: review?(wbamberg)
Updated•11 years ago
|
Attachment #8381009 -
Flags: review?(wbamberg) → review+
Comment 15•11 years ago
|
||
Commits pushed to master at https://github.com/mozilla/addon-sdk
https://github.com/mozilla/addon-sdk/commit/435490c72977a754c775c9f1821809ff709415a6
bug 958609 - this got fixed on python 2.7.6
https://github.com/mozilla/addon-sdk/commit/0a700457d031d20c91d3b56f64664f170af88c75
Merge pull request #1409 from zombie/958609-python-276
bug 958609 - this got fixed on python 2.7.6
You need to log in
before you can comment on or make changes to this bug.
Description
•