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

TypeError when calling shopify.Resource.find with string param #20

Open
mdsn opened this issue Jul 24, 2017 · 0 comments
Open

TypeError when calling shopify.Resource.find with string param #20

mdsn opened this issue Jul 24, 2017 · 0 comments

Comments

@mdsn
Copy link

mdsn commented Jul 24, 2017

Using django and python versions:

  • Django Version: 1.11.3
  • Python Version: 3.6.1

And with the following ShopifyAPI/pyactiveresource versions:

  • pyactiveresource==2.1.2
  • ShopifyAPI==2.5.0

The following code causes the error Exception Value: cannot use a string pattern on a bytes-like object.

    script_url = 'http://someurl.com/path/to.js'
    if not shopify.ScriptTag.find(src=script_url):
        script = shopify.ScriptTag()
        ···

Stack:

···

File "dev/lab/shopify-test/shopify_app/api/views.py" in auth
  58.     if not shopify.ScriptTag.find(src=script_url):

File "dev/env/shopify-test/lib/python3.6/site-packages/pyactiveresource/activeresource.py" in find
  385.         return cls._find_every(from_=from_, **kwargs)

File "dev/env/shopify-test/lib/python3.6/site-packages/pyactiveresource/activeresource.py" in _find_every
  515.         prefix_options, query_options = cls._split_options(kwargs)

File "dev/env/shopify-test/lib/python3.6/site-packages/pyactiveresource/activeresource.py" in _split_options
  466.             if key in cls._prefix_parameters():

File "dev/env/shopify-test/lib/python3.6/site-packages/pyactiveresource/activeresource.py" in _prefix_parameters
  720.         for match in template.pattern.finditer(path):

Exception Type: TypeError at /api/auth/
Exception Value: cannot use a string pattern on a bytes-like object
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

1 participant