Mozrunner doesn't work with Python 2.7 on Windows (cannot import name SW_HIDE).

RESOLVED FIXED

Status

RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: kiav1976, Assigned: avarma)

Tracking

Trunk
x86
Windows Vista
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [mozmill-1.4.2+])

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.9.2.7) Gecko/20100713 MRA 5.6 (build 03399) Firefox/3.6.7 ( .NET CLR 3.5.30729; .NET4.0E)
Build Identifier: 0.5

The bin\activate.bat gives an error

"Verification of Jetpack SDK environment failed (cannot import name SW_HIDE).
Your SDK may not work properly."

Reproducible: Always

Steps to Reproduce:
1. I downloaded https://ftp.mozilla.org/pub/mozilla.org/labs/jetpack/jetpack-sdk-latest.zip at July 22, 2010. There was jetpack-sdk-0.5.
2. I've unpacked it into my E:\Soft folder.
3. I downloaded and installed Python 2.7 into C:\Program Files\Python27 and added C:\Program Files\Python27 into system path variable.
4. Them a entered into E:\Soft\jetpack-sdk-0.5 in the command prompt (cmd.exe) and started bin\activate.bat as was told in Readme.txt
Actual Results:  
Verification of Jetpack SDK environment failed (cannot import name SW_HIDE).
Your SDK may not work properly.


Vista SP2 Home Basic

Comment 1

8 years ago
Move back to Python 2.6 and it is fixed. At least this is what I had to do.
(Reporter)

Comment 2

8 years ago
Thanks. I installed Python 2.6.5 instead of 2.7 (Python 3.1 does not work at all). 

bin\activate.bat yields

Ошибка: Не удается найти указанный раздел или параметр в реестре. (in English something like "Error: Can't find parameter in register")
Welcome to the Jetpack SDK. Run 'cfx docs' for assistance.

But cfx docs successfully opened documentation and cfx testall yields 

"1255 of 1255 tests passed.
OK
Total time: 20.634000 seconds
Program terminated successfully.
All tests were successful. Ship it!"
(Assignee)

Comment 3

8 years ago
Ack, this looks like a bug in mozrunner. I've fixed it here:

  http://github.com/toolness/mozrunner/commit/5ac140ef1d67507cd61deea8a0839c4a1d0ed078

and issued a pull request to mikeal. If he approves it, then I'll copy the change over to the SDK branch.
Assignee: nobody → avarma
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Atul, for patches to Mozmill we normally attach those on Bugzilla and ask for review. Can you do that for your patch and request a review from Heather or Jeff? Mikeal isn't that active todays. Let's move this bug over to the right component.

Looks like a serious issue we should fix for Mozmill 1.4.2.
Assignee: avarma → nobody
Component: Jetpack SDK → MozRunner
Product: Mozilla Labs → Testing
QA Contact: jetpack-sdk → mozrunner
Whiteboard: [mozmill-1.4.2?]
Target Milestone: -- → ---
Version: unspecified → Trunk

Comment 5

8 years ago
(In reply to comment #4)
> Atul, for patches to Mozmill we normally attach those on Bugzilla and ask for
> review. Can you do that for your patch and request a review from Heather or
> Jeff? Mikeal isn't that active todays. Let's move this bug over to the right
> component.
> 
> Looks like a serious issue we should fix for Mozmill 1.4.2.

I'd like to know more about what this actually does.  I'm woefully ignorant of how winprocess.py is supposed to work or the origin of the file.  Though sure enough, I can't import SW_HIDE on linux and am not sure what it is supposed to be.  Any insight?
Atul, for the future, the new mozmill/mozrunner repo is at http://github.com/mozautomation/mozmill. Sounds like something we should take for 1.4.2
Whiteboard: [mozmill-1.4.2?] → [mozmill-1.4.2+]
SW_HIDE is a constant which can be used with various WinAPI functions like
ShowWindow() and CreateProcess() to hide the window.

Doing a ctrl-f of winprocess.py it looks like SW_HIDE isn't even being used so
we can probably just get away with deleting the import statement.  We might
want to double check some of the other constants as well to make sure they're
getting used.
(In reply to comment #6)
> Sounds like something we should take for 1.4.2

I would leave this up for Clint or our next meeting.
Whiteboard: [mozmill-1.4.2+] → [mozmill-1.4.2?]
(Assignee)

Comment 9

8 years ago
(In reply to comment #7)
> Doing a ctrl-f of winprocess.py it looks like SW_HIDE isn't even being used so
> we can probably just get away with deleting the import statement.

I actually checked this too, but the weird thing is that it's being used by killableprocess.py, I think. Which I guess suggests that killableprocess.py should be the one defining it.
(In reply to comment #8)
> (In reply to comment #6)
> > Sounds like something we should take for 1.4.2
> 
> I would leave this up for Clint or our next meeting.

Haven't gotten Clint's email about the leadership for Heather. Restoring the whiteboard flag.
Whiteboard: [mozmill-1.4.2?] → [mozmill-1.4.2+]

Comment 11

8 years ago
(In reply to comment #9)
> (In reply to comment #7)
> > Doing a ctrl-f of winprocess.py it looks like SW_HIDE isn't even being used so
> > we can probably just get away with deleting the import statement.
> 
> I actually checked this too, but the weird thing is that it's being used by
> killableprocess.py, I think. Which I guess suggests that killableprocess.py
> should be the one defining it.

+1
SW_HIDE can be found in the pywin32 "win32con" module in python 2.7 if we don't want to just set it to 0.

Python diff: http://svn.python.org/view/python/tags/r27/Lib/subprocess.py?r1=79064&r2=82504
(Assignee)

Comment 13

8 years ago
Oh, I thought that would be un-preferable since we decoupled mozrunner from PyWin32 in bug 534371. Unless win32con is actually part of Python 2.7, which would be cool.
(In reply to comment #13)
> Oh, I thought that would be un-preferable since we decoupled mozrunner from
> PyWin32 in bug 534371.

Wasn't aware of that.  Afaik win32con is not a part of Python 2.7, so just ignore me :)
(Assignee)

Updated

8 years ago
Summary: Verification of Jetpack SDK environment failed (cannot import name SW_HIDE). → Mozrunner doesn't work with Firefox 2.7 on Windows (cannot import name SW_HIDE).

Updated

8 years ago
Summary: Mozrunner doesn't work with Firefox 2.7 on Windows (cannot import name SW_HIDE). → Mozrunner doesn't work with Python 2.7 on Windows (cannot import name SW_HIDE).
(Assignee)

Comment 15

8 years ago
Created attachment 464638 [details] [diff] [review]
patch
(Assignee)

Comment 16

8 years ago
Comment on attachment 464638 [details] [diff] [review]
patch

Ok, I ended up putting SW_HIDE in winprocess anyways, since it seems to contain a number of other windows constants that are being used by various things.
Attachment #464638 - Flags: review?(harthur)
Comment on attachment 464638 [details] [diff] [review]
patch

works on Windows and not Windows, thanks!
Attachment #464638 - Flags: review?(harthur) → review+
Atul, does anything need to be done on the Jetpack side for us to pick this up? People have come into the channel on several occasions with this problem, and it's not clear from this bug whether it's fixed in Jetpack SDK 0.7.
(Assignee)

Comment 20

8 years ago
Er, sorry, I should've posted to this earlier... I filed Jetpack SDK Bug 586412, "Update mozrunner to latest trunk", and fixed that, so this should be fixed in the latest Jetpack trunk.

In other words, nope, I don't think anything needs to be done on the Jetpack side!
Assignee: nobody → avarma
You need to log in before you can comment on or make changes to this bug.