Closed Bug 551307 Opened 10 years ago Closed 10 years ago

Python error when running cfx test on Windows


(Add-on SDK Graveyard :: General, defect, P1, blocker)

Windows 7


(Not tracked)



(Reporter: sylvain.pasche, Assigned: avarma)




(1 file)

(C:\jetpack-sdk-0.1) C:\jetpack-sdk-0.1\packages\my-first-package> cfx test
Traceback (most recent call last):
  File "C:\jetpack-sdk-0.1\bin\cfx", line 6, in <module>
  File "C:\jetpack-sdk-0.1\python-lib\cuddlefish\", line 287, in run
    pkg_cfg = packaging.build_config(env_root, target_cfg)
  File "C:\jetpack-sdk-0.1\python-lib\cuddlefish\", line 139, in build_config
    if not os.path.samefile(otherpkg.root_dir, path):
AttributeError: 'module' object has no attribute 'samefile'

Apparently, os.path.samefile is Unix only.
Assignee: nobody → avarma
Severity: normal → blocker
Priority: -- → P1
Sorry about that, will fix this ASAP.
Blocks: 550511
Attached patch Patch for bug.Splinter Review
This should fix it; I tested it on Windows 7 and it works okay, though I found a few other Windows bugs in the process.
Closed: 10 years ago
Resolution: --- → FIXED
Added this to the "known issues" section of 0.1:
I made the fix based on your attachment diff and am now getting this:

(C:\jetpack) C:\jetpack\packages\my-first-package>cfx test
Traceback (most recent call last):
  File "C:\jetpack\bin\cfx", line 6, in <module>
  File "C:\jetpack\python-lib\cuddlefish\", line 287, in run
    pkg_cfg = packaging.build_config(env_root, target_cfg)
  File "C:\jetpack\python-lib\cuddlefish\", line 145, in build_confi
    raise DuplicatePackageError(path, otherpkg.root_dir)
cuddlefish.packaging.DuplicatePackageError: ('C:\\jetpack\\packages\\my-first-pa
ckage', 'C:\\jetpack\\packages\\my-first-package')
Hmm, did you actually apply the diff or make a similar change? My fix should specifically not raise a DuplicatePackageError in that situation, as those two strings are equal... Hmm.

What version of Windows are you using?
Vista Home Premium 64bit
Worked fine for me. 

I think you will find quite a few windows developers who are not used to apply diff patches.

Would you mind leading me in the right direction in regards to "apply diff patches" the proper way. Maybe I did it wrong.
1) Go here:

2) Download the "Binary" zipped version

3) In the zip find /bin/patch.exe extract it to C:/Windows/ or a custom location that is specified in your PATH environment variable. 

*Note: I don't normally suggest extracting custom binaries to C:/Windows/. It is better to create a custom location such as C:/bin or C:/<path to My Documents>/bin and manually add it to your PATH environment variable. Google how to do this if you wish.

4) Test to make sure path.exe can be found via your command window. Open a new command window. Type "patch -v"; the patch.exe version information should be printed. If you get an error that is similar to: 'patch is not recognized as an internal or external command' you didn't put patch.exe in a location that is also specified in your PATH environment variable. Close the console window, try placing patch.exe again/adding its location to your PATH, test again.

5) Once patch.exe can be found via command line, visit Atul's link above. Find the link "raw" at the top, right click and chose "Save As..." or "Save Link As..." depending on your browser.

6) Save the file as "packagingPatch.txt" (or anything you want really, extension doesn't matter either) to <your jetpack location>\python-lib\cuddlefish\

7) Navigate your command window to <your jetpack location>\python-lib\cuddlefish\

8) execute: patch packagingPatch.txt

9) Done, delete packagingPatch.txt if you want. If you encountered any errors from the patch program, it should provide helpful instructions and/or ask for relevant information.
Blocks: 551040
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product.

To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
Version: 0.1 → unspecified
You need to log in before you can comment on or make changes to this bug.