Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console Error on Windows: 'Module has no attribute symlink' #104

Closed
davidstackio opened this issue Jun 20, 2015 · 10 comments
Closed

Console Error on Windows: 'Module has no attribute symlink' #104

davidstackio opened this issue Jun 20, 2015 · 10 comments

Comments

@davidstackio
Copy link

After succesfully configuring the yaml file (after applying fix proposed in issue #103), I got the symlink error on Windows.

Looks like this might be a potential fix (add to top of shopify_api.py):

if os.name == "nt":
    def symlink_ms(source, link_name):
        import ctypes
        csl = ctypes.windll.kernel32.CreateSymbolicLinkW
        csl.argtypes = (ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_uint32)
        csl.restype = ctypes.c_ubyte
        flags = 1 if os.path.isdir(source) else 0
        try:
            if csl(link_name, source.replace('/', '\\'), flags) == 0:
                raise ctypes.WinError()
        except:
            pass
    os.symlink = symlink_ms

Fix Source
Needs to be tested further.

@kevinhughes27
Copy link
Contributor

are you able to test these?

@davidstackio
Copy link
Author

I put the code above in my code and it worked. However, I ended up just using my own console to test shopify.

For issue #103 that proposed fix works and is needed to even get the console up and running.

@kevinhughes27
Copy link
Contributor

I mean test that it still works on the other OSes

@davidstackio
Copy link
Author

Ah, I am not able to test on other OSes as I only have Windows machines

@asiviero
Copy link
Contributor

All tests passed on Linux

@kevinhughes27
Copy link
Contributor

The issue that the cli is not tested by the test suite someone has to just use it (or write a test suite for it). We actually removed the cli from the ruby gem since it was sort of a separate thing

@asiviero
Copy link
Contributor

Alright, I can take a look at that as well

@kevinhughes27
Copy link
Contributor

Thanks!

@asiviero
Copy link
Contributor

I was able to create a product from the console with that fix. I guess it should work for most uses since it looks like sugar to some boring set up tasks. I'll take a look at the ruby test suite so I can be more certain on that.

@kevinhughes27
Copy link
Contributor

sweet thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants