Getting TypeError when trying to Webhook.find()
See original GitHub issueJust updated to latest everything: py3.5 ShopifyAPI (2.1.5) pyactiveresource (2.1.2)
And the following code:
if not shopify.Webhook.find(topic='orders/paid'):
Raise the following exception:
File ".../venv/lib/python3.5/site-packages/pyactiveresource/activeresource.py", line 720, in _prefix_parameters
for match in template.pattern.finditer(path):
TypeError: cannot use a string pattern on a bytes-like object
Some basic print debug shows the value of path
at that point is b’'.
If I modify the offending code to use path.encode('utf-8')
it succeeds, but fails later at:
File ".../venv/lib/python3.5/site-packages/pyactiveresource/activeresource.py", line 737, in _prefix
path = re.sub('/$', '', cls.prefix_source)
File ".../venv/lib/python3.5/re.py", line 182, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: cannot use a string pattern on a bytes-like object
So either this is byte/string failure in pyactiveresource, or ShopifyAPI isn’t setting values on its Webhook resource that the other lib needs.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Error when extracting data from JSON webhook - Stack Overflow
I am getting a Type Error for the json.loads(resp) ``` TypeError: the JSON object must be str, bytes or bytearray, not dict ```...
Read more >Slack webhook in Zabbix
Hi, Recently upgraded to 5.2.0 on one of my installations. As we would like to have the notifications in Slack, I tried it...
Read more >Errors - discord.js Guide
This error is caused by spawning a large number of event listeners, usually for the client. The most common cause of this is...
Read more >PHP Fatal error: Uncaught TypeError: call_user_func_array()
Hello, My theme and woocommerce work great together until I update php from 7.4 to 8.0. I get this message from my hosting...
Read more >Solved: application/x-www-form-urlencoded content type err...
I'm going to try to post a very quick summary of how I got this to work, with a Mailchimp webhook triggering a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had this issue when I did not activate the session prior to making the .find() call
shopify.ShopifyResource.activate_session(session)
I’m not able to replicate this in Python 2.7.9 or 3.5.1. As suggested by the other commenter, make sure your session is initialized first.
If anyone is able to replicate this, please feel free to re-open it.